Text = input().split(' ') Text.sort(key=lambda x:x[2]) for i in Text: print(i, end = ' ')