res = input().split()
res.sort(key=lambda x: x[1])
print(' '.join(res))