Var k,i,l,g,a,b:integer; N:longint; f:text; Begin Assign(f,'change.txt'); Reset(f); Readln(f,N); k:=1; While N>0 do begin If N div 10<>0 then k:=k+1; N:=N div 10; end; Close(f); Reset(f); Read(f,N); l:=1; for i:=1 to (k-1) do begin l:=l*10; end; Close(f); a:=N div l; b:=N mod 10; g:=b*l+(N-a*l-(n mod 10)+a); Writeln(g); End.