uses crt;
var n,i,d,x,j,tam:longint;
a:array[1..255]of longint;
st:string;
begin
clrscr;
write('Nhap n='); readln(n);
str(n,st);
d:=length(st);
for i:=1 to d do
val(st[i],a[i],x);
for i:=1 to d-1 do
for j:=i+1 to d do
if a[i]<a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
for i:=1 to d do
write(a[i]);
readln;
end.