array = input().split() new_array = sorted(array, key = lambda i: i[1]) print(" ".join(new_array))