n=list(map(str,input().split())) print (' '.join(map(str,sorted(n,key=lambda x: x[1]))))