program chislo;
var x,a,b,c,d: integer;
begin
writeln ('vvedit triohznachne chislo');
readln (x);
a:=x div 100;
b:=(x-a*100) div 10;
c:=x mod 10;
if (a>=b) and (b>=c) then
d:=a*100+b*10+c;
if (a>=c) and (c>=b) then
d:=a*100+c*10+b ;
if (b>=a) and (a>=c) then
d:=b*100+a*10+c;
if (b>=c) and (c>=a) then
d:=b*100+c*10+a;
if (c>=b) and (b>=a) then
d:=c*100+b*10+a;
if (c>=a) and (a>=b) then
d:=c*100+a*10+b;
writeln (d);
readln
end.