program sie(input,output);
var
a:Array[1..200,1..200]of longint;
i,j,k:integer;
n:integer;
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]);
readln;
end;
close(input);
assign(output,'sie.out');
rewrite(output);
for i:=n downto 1 do
for j:=n downto i+1 do
for k:=n downto i+1 do
if (a[i,j]<>0)and(a[j,k]<>0)and(a[i,k]<>0)and
(a[i,j]+a[j,k]<>a[i,k]) then
writeln(i,' ',k);
close(output);
end.