for(string s:input("/dev/stdin",true,"")){int l=length(s);write(l<2?s:substr(s,l-1)+substr(s,1,l-2)+substr(s,0,1));}