s = input().split() a = sorted(s, key= lambda x: x[1], reverse=False) print(" ".join(a))