var a: array [1..100,1..100] of longint ;i, j ,d, n,m,k: longint;beginread(n,m);
for i:=1 to n do for j:= 1 to m doread(a[i,j]);
j:=0;
for i:=1 to n do begin j:=j+1; d:=0; while d<2 do if a[i,j]<0 then begin k:=k+1; d:= 3; end; end;<br>
if k>(m/2) then begin for i:= 1 to n do for j:= 1 to m do if a[i,j]<0 then a[i,j]:=a[i,j]*10 ;<br> end
else
begin for i:=1 to n do for j:= 1 to m do if a[i,j]<0 then a[i,j]:=a[i,j]*a[i,j] ;end;<br>for i:=1 to n dobegin for j:= 1 to m dowrite(a[i,j],' ');end;end.