var i,m,n,u:integer;
c:array[1..20] of integer;
b:array[1..10] of integer;
begin
m:=1;
n:=20;
u:=1;
for i:=1 to 20 do
read(c[i]);
for i:=1 to 10 do
begin
b[i]:=c[m]+c[n];
m:=m+1;
n:=n-1;
end;
for i:=1 to 10 do
if b[i]>b[u] then u:=i;
write(b[u]:4);
end.