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