a = list(map(str,input().split()))
def sortByAlphabet(inputStr):
    return inputStr[1]
a.sort(key=sortByAlphabet)
for i in a:
    print(i,end=' ')