uses crt;
var st,st1,st2:string;
i,d,dem,kt,j,x:integer;
a,b:array[1..255]of integer;
begin
clrscr;
write('Nhap chuoi:'); readln(st);
st1:=''
st2:=''
d:=length(st);
for i:=1 to d do
begin
if st[i] in ['0'..'9'] then st1:=st1+st[i]
else if (st[i] in ['a'..'z']) or (st[i] in ['A'..'Z']) then st2:=st2+st[i];
end;
for i:=1 to length(st1) do
val(st1[i],a[i],x);
b[1]:=a[1];
dem:=1;
for i:=1 to length(st1) do
begin
kt:=0;
for j:=1 to dem do
if a[i]=b[j] then kt:=1;
if kt=0 then
begin
inc(dem);
b[dem]:=a[i];
end;
end;
writeln('Cac so co trong day la: ');
for i:=1 to dem do
write(b[i]:4);
writeln;
writeln('Cac chu co trong day la:');
for i:=1 to length(st2) do
write(st2[i]:4);
readln;
end.