for i:=1 to n do for j:=1 to m do if R[i,j]=-1 then begin x:=i; y:=j; for min:=1 to m do write('-'); writeln; end; writeln(f2,'start=(',x,';',y,')'); writeln(f2,'kilkist xodiv=',Ni-1); 11: if R[x,y-1]=Ni then begin x1:=x; y1:=y-1; writeln(f2,x1,' ',y1); goto A; end; if R[x,y+1]=Ni then begin x1:=x; y1:=y+1; writeln(f2,x1,' ',y1); goto A; end; if R[x+1,y]=Ni then begin x1:=x+1; y1:=y; writeln(f2,x1,' ',y1); goto A; end; if R[x-1,y]=Ni then begin x1:=x-1; y1:=y; writeln(f2,x1,' ',y1); goto A; end; A:ni:=Ni-1; if Ni=1 then goto 15; x:=x1; y:=y1; goto 11; 15:close(f2);