for x in sorted(input().split(), key=lambda x: x[1]):
	print(x, end=' ')