s=raw_input() l='' f='' for c in s: if c.isdigit():c=l[len(l)-1-int(c)] if c.isalpha(): l+=c f+=c else:f+=c print f