var c:char;s:string;begin repeat readln(c,s);writeln(copy(s+s,length(s),length(s)),c)until 0>0end.