#include<cstdio>
#include<cctype>
#include<algorithm>
const int maxn=1e4+5;
using namespace std;
inline long long get();
int n;
long long N[maxn];
long long mx;
int main()
{
freopen("1.in","r",stdin);
freopen("1.out","w",stdout);
n=get();
for(int i=1;i<=n;i++)N[i]=get();
sort(N+1,N+n+1);
int i=1,j=n;
while(i<j)
{
if(N[i]+N[j]>mx)mx=N[i]+N[j];
i++;j--;
}
printf("%lld",mx);
return 0;
}
inline long long get()
{
long long t=0,jud=1;char c=getchar();
while(!isdigit(c))
{
if(c=='-')jud=-1;
c=getchar();
}
while(isdigit(c))
{
t=(t<<3)+(t<<1)+c-'0';
c=getchar();
}
return t*jud;
}