{
    Решение избранных задач
    © 2024 Слинкин Д.А., GNU LGPLv3

 **********************************************************************}

{$mode objfpc}
var s:string;
    res:array[1..3] of string;
    i:integer;
begin
 readln(s);
 res[1]:=s;res[1][1]:=s[3];res[1][3]:=s[1];
 res[2]:=s;res[2][1]:=s[2];res[2][2]:=s[1];
 res[3]:=s;res[3][2]:=s[3];res[3][3]:=s[2];
 for i:=1 to 3 do if res[i]>s then s:=res[i];

 writeln(s);
end.