program sie(input,output);
var
a:array[1..200,1..200]of integer;
n,i,k,j:integer;
flag:boolean;
begin
assign(input,'sie.in');
reset(input);
readln(n);
for i:=1 to n do
begin
for j:=1 to n do
read(a[i,j]);
end;
close(input);
assign(output,'sie.out');
rewrite(output);
for i:=1 to n do
if i+1<=n then
begin
for j:=i+1 to n do
begin
flag:=true;
for k:=1 to n do
if (a[i,j]=a[i,k]+a[k,j])and(a[i,k]<>0)and(a[k,j]<>0) then
begin
flag:=false;
end;
if flag=true then writeln(i,' ',j);
end;
end;
close(output);
end.