implicit none
integer :: n,i,s,ss,sss
integer,allocatable,dimension(:):: a,b
s=0
ss=0
sss=0

read(5,*) n
allocate(a(n))
allocate(b(n))

read(5,*) (a(i),i=1,n)
read(5,*) (b(i),i=1,n)

do i=1,n
    s=s+a(i)
    a(i)=s
    ss=ss+b(n-i+1)
    b(n-i+1)=ss
enddo

do i=1,n
     sss=max(a(i)+b(i),sss)
enddo

write(6,*) sss
 
end