
lst = list(map(int, input().split()))

def mergeSort_ASC(arr):
    if len(arr) > 1:
        mid = len(arr)//2
        left_half = arr[:mid]
        right_half = arr[mid:]

        mergeSort_ASC(left_half)
        mergeSort_ASC(right_half)

        i,j,k = 0, 0, 0

        while i < len(left_half) and j < len(right_half):
            if left_half[i] < right_half[j]:
                arr[k] = left_half[i]
                i += 1
            else:
                arr[k] = right_half[j]
                j += 1
            k += 1
        while i < len(left_half):
            arr[k] =left_half[i]
            i += 1
            k += 1
        while j < len(right_half):
            arr[k] = right_half[j]
            j += 1
            k += 1

def merge_sorted(arr):
    if len(arr) > 1:
        mid = len(arr)//2
        left = arr[:mid]
        right = arr[mid:]

        l = merge_sorted(left)
        r = merge_sorted(right)

        return merge(l, r)

    else:
        return arr
        
def merge(left, right):
    i,j = 0, 0
    arr = []

    while i <len(left) and j < len(right):
        if left[i] < right[j]:
            arr.append(left[i])
            i += 1
        else:
            arr.append(right[j])
            j += 1
    while i < len(left):
        arr.append(left[i])
        i += 1
    while j < len(right):
        arr.append(right[j])
        j += 1
        
    return arr


print("First Sorted Version is : ", merge_sorted(lst))
print("Original List Before Sorted is : ", lst)
# mergeSort_ASC(lst)
# print("Second Sorted Version is : " , lst)

