l=list(input().split(' ')) l.sort(key=lambda x:x[1]) print(*l)