uses crt;
type vitri=array[1..3] of integer;
so=array[1..9] of string;
var s,dem,i:integer;
Vt:vitri;
doc:so;
procedure docso(n:integer);
begin
doc[1]:='mot';
doc[2]:='hai';
doc[3]:='ba';
doc[4]:='bon';
doc[5]:='nam';
doc[6]:='sau';
doc[7]:='bay';
doc[8]:='tam';
doc[9]:='chin';
write(doc[n]);
end;
begin
clrscr;
repeat
write('Nhap so can doc ');readln(s);
until (s>=100) and (s<=999);
for i:=1 to 3 do
begin
vt[4-i]:=s mod 10;
s:=s div 10;
end;
docso(VT[1]);
write(' tram ');
if VT[2]=1 then write('') else docso(VT[2]);
if VT[2]=0 then write('le ') else write(' muoi ');
docso(VT[3]);
readln;
end.