a=list(map(str,input().split())) b = list((map(str,sorted(a,key=lambda x: x[2])))) print(*b)