program Project1;
var
  a:char;
  h,n,i,j:integer;
begin
    read(h,n);
    for i:=1 to h do
        begin
        for j:=1 to n do
            begin
            read(a);
            end;
            end;



    write('-1');

end.