uses dos;
var HXs:string;
oldI5:pointer;
const HX='0123456789ABCDEF';
{$F+,S-}
procedure i5;interrupt;
begin
writeln(000);
end;
{$F-,S+}

function whb(_dt:byte):string;
begin
whb:=HXs[(_dt shr 4)+1]+HXs[(_dt and $0F)+1];
end;
function whw(_dt:word):string;
begin
whw:=whb(hi(_dt))+whb(lo(_dt));
end;

var xx:word;
begin
getintvec(5,oldi5);
setintvec(5,@i5);
HXs:=HX;
repeat
asm
mov ah,$10
int $16
mov xx,ax
end;
writeln(whw(xx));
until lo(xx)=27;
setintvec(5,oldi5);
end.