program fordito;
var fi:file of shortint;
    t,x,y,z:shortint;
    s:string;

begin
   write('Filename:');readln(s);
   assign(fi,s);
   rewrite(fi);
   t:=1;
   repeat
     write(t:2,':');readln(x,y,z);
     write(fi,x,y,z);
     inc(t);
   until x=127;

   writeln('LineTo sequents');
   repeat
      readln(x);
      write(fi,x);
   until x=127;
   close(fi);
end.