Program gt;
var a:array[1..100,1..100]of integer;
n,m,i, j ,q:integer;
begin
read(n,m);
q:=0;
for i:=1 to n do
for j:=1 to m do
begin
read(a[i, j]);
if(a[i, j]>100)then q:=1;
end;
if(q=1)then begin
for i:=1 to n do
for j:=1 to m do
if(i=j)or(i=m-j+1)then a[i,j]:=0;
end;
for i:=1 to n do
begin
for j:=1 to m do
write(a[i, j],' ');
writeln;
end;
end.