while 1: r=raw_input()*2;i=0;o="" while i-52:o+=r[i];i=r.find(r[i],i+1)%52+1 print o