s=input() a=[] b=[] for c in s: if 'a'<=c<='z': a+=c, else: b+=c, print(*a[::-1]+b,sep='')