t=System.in.text s=t[7..-1]as List i=-2 while(1)print'e'>t?(s=s.reverse()).pop():s[i+=2]?:s[2010-i]