Var
n,m,i,j,k1,k2: integer;
a: array[1..100,1..100] of integer;
begin
readln(n,m);
for i:=1 to n do
for j:=1 to n do readln(a[i,j]);
for i:=1 to n do
for j:=1 to n do
if a[i,j]>0 then inc(k1) else inc(k2);
for i:=1 to n do
for j:=1 to n do
if (k1>k2) and (a[i,j]>0) then writeln(a[i,j]) else
if (k1end.