program split_0;
var addr_bits,data_bits : integer;
    rom:array[0..255] of integer;
    mult_inst, addr:integer;
    in_file,out_file:text;

begin;
  assign(in_file,'out0.dmp');
  reset(in_file);
  readln(in_file,addr_bits);
  readln(in_file,data_bits);
  for addr:=0 to 255 do readln(in_file,rom[addr]);
  close(in_file);

  for mult_inst:=0 to 3 do begin;
    assign(out_file,'out0'+chr(65+mult_inst)+'.dmp');
    rewrite(out_file);
    writeln(out_file,addr_bits-2:0);
    writeln(out_file,data_bits);
    for addr:=0 to 63 do
      writeln(out_file,rom[(addr div 16)*64 + mult_inst*16+(addr mod 16)]:0);
    close(out_file);
  end;
end.
