var
n,m,r:integer;
s:string;
begin
l.Items.clear;
m:=strtoint(e.Text);
n:=strtoint(e1.Text);
repeat
r:=m mod n;
m:=m div n;
if r>9 then
begin
if r=10 then s:='A';
if r=11 then s:='B';
if r=12 then s:='C';
if r=13 then s:='D';
if r=14 then s:='E';
if r=15 then s:='F';
l.Items.add(string();
end;
if r<9 then
l.Items.add(inttostr(r));
until m=0;
begin
end;
end;