var s,t:string;i:word;begin repeat readln(s);t:=t+s+^j until eof;for i:=length(t)-ord(t[2]<>^j)downto 1do write(t[i])end.