uses crt;
const left=#75; right=#77; up=#72; down=#80;
var x, y, b: integer;
c: char;
begin
clrscr;
x:=1;
y:=1;
gotoxy(x,y);
write('a');
repeat
c:=readkey;
case c of
left:
begin
clrscr;
x:=x-1;
gotoxy(x,y);
write('a');
b:=b+1;
end;
right:
begin
clrscr;
x:=x+1;
gotoxy(x,y);
write('a');
b:=b+1;
end;
up:
begin
clrscr;
y:=y+1;
gotoxy(x,y);
write('a');
b:=b+1;
end;
down:
begin
clrscr;
y:=y-1;
gotoxy(x,y);
write('a');
b:=b+1;
end;
until
b=10;
readkey;
end.