var
n: integer;
begin
readln(n);
writeln((n div 1000) * 1000 + (n mod 1000 mod 10) * 100 + (n mod 1000 mod 100 div 10) * 10 + (n mod 1000 div 100))
end.
var
n: integer;
begin
readln(n);
writeln((n div 1000) * 1000 + (n mod 1000 mod 10) * 100 + (n mod 1000 mod 100 div 10) * 10 + (n mod 1000 div 100))
end.