Program MakeArt;

const

  n = 6;

  m = 576;

  Forever: boolean = false;

var

  XFile: text;

  XNum: integer;

  Line24:  string[24];

  OutStr: string;

  alpha, bravo: integer;

  BitInt: array[1..24] of integer;

  DumInt:  integer;



begin

  XNum := 0;

  repeat

    XNum := XNum + 1;

    Str(XNum,OutStr);

    OutStr := 'XFILE' + OutStr + '.SYM';

    Assign(XFile, OutStr);

    Rewrite(XFile);

    for alpha := 1 to trunc(sqrt(m)) do

      begin

        readln(Line24);

        for bravo := 1 to trunc(sqrt(m)) do

          begin

            val(Line24[bravo],BitInt[bravo],DumInt);

            writeln(XFile, BitInt[bravo]);

          end;

      end;

    Close(XFile);

    write(#7);

    readln;

  until Forever;

end.