t="" while 1: n=52;s=raw_input(t)*2;t="\n" while n:n=s.find(s[n-1],n)%52;t=s[n]+t