var n,n1,n2,n3:integer;function srostit(a,b,c:integer):integer;begin srostit := a*100 + b*10 + c;end;Begin read(n); n1:=n div 100; n2:=n mod 100 div 10; n3:=n mod 10; writeln(srostit(n1,n2,n3)); writeln(srostit(n1,n3,n2)); writeln(srostit(n2,n1,n3)); writeln(srostit(n2,n3,n1)); writeln(srostit(n3,n1,n2)); writeln(srostit(n3,n2,n1));End.
var n,n1,n2,n3:integer;
function srostit(a,b,c:integer):integer;
begin
srostit := a*100 + b*10 + c;
end;
Begin
read(n);
n1:=n div 100;
n2:=n mod 100 div 10;
n3:=n mod 10;
writeln(srostit(n1,n2,n3));
writeln(srostit(n1,n3,n2));
writeln(srostit(n2,n1,n3));
writeln(srostit(n2,n3,n1));
writeln(srostit(n3,n1,n2));
writeln(srostit(n3,n2,n1));
End.