arr = input().split()
print(*sorted(arr, key=lambda x: x[1]))