program tach_ho_ten;
uses crt;
var
s, ho_dem, ten: string;
i, vt: integer;
begin
write('Nhap xau s: ');
readln(s);
vt := 0;
for i := length(s) downto 1 do
begin
if s[i] = ' ' then
begin
vt := i;
break;
end;
end;
ho_dem := copy(s, 1, vt-1);
ten := copy(s, vt+1, length(s)-vt);
writeln('Ho dem: ', ho_dem);
writeln('Ten : ', ten);
readln;
end.