program cojs987;
var
a:array[1..500,1..500] of longint;
i,j,n,max1,max2,maxans:longint;
begin
assign(input,'sanguo.in');
assign(output,'sanguo.out');
reset(input);
rewrite(output);
writeln(1);
readln(n);
for i:=1 to n do
for j:=i+1 to n do
begin
read(a[i,j]);
a[j,i]:=a[i,j];
end;
maxans:=0;
for i:=1 to n do
begin
max1:=0; max2:=0;
for j:=1 to n do
begin
if a[i,j]>max1 then
begin
max2:=max1;
max1:=a[i,j];
end;
if (a[i,j]>max2)and(a[i,j]<max1) then
max2:=a[i,j];
end;
if max2>maxans then
maxans:=max2;
end;
writeln(maxans);
close(input);
close(output);
end.