var
n,i,max,ca:longint;
a:array[0..10000] of longint;
procedure swap(var a,b:longint);
var
temp:longint;
begin
temp:=a;
a:=b;
b:=temp;
end;
procedure sort(l,r:longint);
var
i,j,x:longint;
begin
i:=l;
j:=r;
x:=a[(l+r) div 2];
repeat
while a[i]<x do
inc(i);
while x<a[j] do
dec(j);
if i<=j then
begin
swap(a[i],a[j]);
inc(i);
dec(j);
end;
until i>j;
if l<j then
sort(l,j);
if i<r then
sort(i,r);
end;
begin
assign(input,'1.in');
assign(output,'1.out');
reset(input);
rewrite(output);
//while not(eof) do
//begin
readln(n);
for i:=1 to n do
read(a[i]);
sort(1,n);
max:=0;
for i:=1 to (n div 2) do
begin
ca:=a[i]+a[n-i+1];
if ca>max then
max:=ca;
end;
writeln(max);
//end;
close(input);
close(output);
end.