program self2;
var 
 a:array[1..10000] of char; i:word; 
 f:file of char; b:char;
function  M:boolean; begin M:=a[i]=chr(42) end;
procedure P(b:byte); begin a[i]:=chr(b); inc(i) end;
procedure C; begin write(a[i]); inc(i) end;
procedure L; begin repeat dec(i) until M end;
procedure W; begin writeln(' P(',ord(a[i]),');'); inc(i) end;
begin
 i:=0;
 
 assign(f,'self2.gen'); reset(f);
 while not eof(f) do begin read(f,b); P(ord(b)) end;
 close(f);
         
 L;L;L;inc(i);
 repeat C until M;
 L;
 repeat W until M;
 repeat W until M;
 W;
 L;L;inc(i);
 repeat C until M;
 { Do something else here }
end.
