def quicksort(lo, hi, vec):
i = lo
j = hi
pivot = vec[ (lo + hi) >> 1]
while i <= j:
while vec[i] < pivot:
i += 1
while vec[j] > pivot:
j -= 1
if i <= j:
aux = vec[i]^vec[j]
vec[i] = aux ^ vec[i]
vec[j] = aux ^ vec[j]
i += 1
j -= 1
if lo < j:
quicksort(lo, j, vec)
if i < hi:
quicksort(i, hi, vec)
def main():
vec = [9,8,7,6,5,4,3,2,1,0]
N = len(vec)
for i in range(0, N):
print(vec[i], end = ' ')
quicksort(0, N - 1, vec)
print()
for i in range(0, N):
print(vec[i], end = ' ')
print()
main()
# your code goes here
ZGVmIHF1aWNrc29ydChsbywgaGksIHZlYyk6CgogICAgaSA9IGxvCiAgICBqID0gaGkKICAgIHBpdm90ID0gdmVjWyAobG8gKyBoaSkgPj4gMV0KCiAgICB3aGlsZSBpIDw9IGo6CiAgICAgICAgd2hpbGUgdmVjW2ldIDwgcGl2b3Q6CiAgICAgICAgICAgICAgaSArPSAxCiAgICAgICAgd2hpbGUgdmVjW2pdID4gcGl2b3Q6CiAgICAgICAgICAgICAgaiAtPSAxCiAgICAgICAgaWYgaSA8PSBqOgogICAgICAgICAgICBhdXggPSB2ZWNbaV1edmVjW2pdCiAgICAgICAgICAgIHZlY1tpXSA9IGF1eCBeIHZlY1tpXQogICAgICAgICAgICB2ZWNbal0gPSBhdXggXiB2ZWNbal0KICAgICAgICAgICAgaSArPSAxCiAgICAgICAgICAgIGogLT0gMQogICAgaWYgbG8gPCBqOgogICAgICAgIHF1aWNrc29ydChsbywgaiwgdmVjKQogICAgaWYgaSA8IGhpOgogICAgICAgIHF1aWNrc29ydChpLCBoaSwgdmVjKSAgICAgICAgICAgICAgCgpkZWYgbWFpbigpOgogICAgdmVjID0gWzksOCw3LDYsNSw0LDMsMiwxLDBdCgogICAgTiA9IGxlbih2ZWMpCgogICAgZm9yIGkgaW4gcmFuZ2UoMCwgTik6CiAgICAgICAgcHJpbnQodmVjW2ldLCBlbmQgPSAnICcpCgogICAgcXVpY2tzb3J0KDAsIE4gLSAxLCB2ZWMpCgogICAgcHJpbnQoKQoKICAgIGZvciBpIGluIHJhbmdlKDAsIE4pOgogICAgICAgIHByaW50KHZlY1tpXSwgZW5kID0gJyAnKQoKICAgIHByaW50KCkKbWFpbigpCiMgeW91ciBjb2RlIGdvZXMgaGVyZQ==