#include<stdio.h>
int main(void) {
  int n;
  scanf("%d", &n);
  int a[2][n];
  int i, j;
  for (i = 0; i < 2; i++)
    for (j = 0; j < n; j++)
      scanf("%d", &a[i][j]);
  int ans = a[0][0];
  int k;
  for (k = 0; k < n; k++) {
    ans += a[1][k];
  }
  for (k = 1; k < n; k++) {
    int t = 0;
    int l;
    for (l = 0; l < k; l++)
      t += a[0][l];
    for (l = k - 1; l < n; l++)
      t += a[1][l];
    if (t > ans)
      ans = t;
  }
  printf("%d", ans);
  return 0;
}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_609/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_609/source.m"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1

; Function Attrs: minsize nofree nounwind optsize uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
  %n = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
  %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) #6
  %0 = load i32, ptr %n, align 4, !tbaa !5
  %1 = zext i32 %0 to i64
  %2 = call ptr @llvm.stacksave.p0()
  %3 = shl nuw nsw i64 %1, 1
  %vla = alloca i32, i64 %3, align 16
  br label %for.cond

for.cond:                                         ; preds = %for.inc7, %entry
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.inc7 ], [ 0, %entry ]
  %exitcond.not = icmp eq i64 %indvars.iv70, 2
  br i1 %exitcond.not, label %for.end9, label %for.cond1.preheader

for.cond1.preheader:                              ; preds = %for.cond
  %4 = mul nuw nsw i64 %indvars.iv70, %1
  %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %4
  br label %for.cond1

for.cond1:                                        ; preds = %for.cond1.preheader, %for.body3
  %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ]
  %5 = load i32, ptr %n, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %cmp2 = icmp slt i64 %indvars.iv, %6
  br i1 %cmp2, label %for.body3, label %for.inc7

for.body3:                                        ; preds = %for.cond1
  %arrayidx5 = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv
  %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br label %for.cond1

for.inc7:                                         ; preds = %for.cond1
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  br label %for.cond

for.end9:                                         ; preds = %for.cond
  %7 = load i32, ptr %vla, align 16, !tbaa !5
  %8 = load i32, ptr %n, align 4, !tbaa !5
  %arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %1
  %smax = call i32 @llvm.smax.i32(i32 %8, i32 0)
  %wide.trip.count = zext i32 %smax to i64
  br label %for.cond12

for.cond12:                                       ; preds = %for.body14, %for.end9
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.body14 ], [ 0, %for.end9 ]
  %ans.0 = phi i32 [ %add, %for.body14 ], [ %7, %for.end9 ]
  %exitcond76.not = icmp eq i64 %indvars.iv73, %wide.trip.count
  br i1 %exitcond76.not, label %for.cond21.preheader, label %for.body14

for.cond21.preheader:                             ; preds = %for.cond12
  %9 = sext i32 %8 to i64
  %wide.trip.count87 = zext i32 %8 to i64
  br label %for.cond21

for.body14:                                       ; preds = %for.cond12
  %arrayidx17 = getelementptr inbounds i32, ptr %arrayidx15, i64 %indvars.iv73
  %10 = load i32, ptr %arrayidx17, align 4, !tbaa !5
  %add = add nsw i32 %10, %ans.0
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  br label %for.cond12

for.cond21:                                       ; preds = %for.cond21.preheader, %for.end43
  %indvars.iv89 = phi i64 [ 1, %for.cond21.preheader ], [ %indvars.iv.next90, %for.end43 ]
  %indvars.iv82 = phi i64 [ 0, %for.cond21.preheader ], [ %indvars.iv.next83, %for.end43 ]
  %ans.1 = phi i32 [ %ans.0, %for.cond21.preheader ], [ %spec.select, %for.end43 ]
  %cmp22 = icmp slt i64 %indvars.iv89, %9
  br i1 %cmp22, label %for.cond24, label %for.end47

for.cond24:                                       ; preds = %for.cond21, %for.body26
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body26 ], [ 0, %for.cond21 ]
  %t.0 = phi i32 [ %add30, %for.body26 ], [ 0, %for.cond21 ]
  %exitcond81.not = icmp eq i64 %indvars.iv77, %indvars.iv89
  br i1 %exitcond81.not, label %for.cond34, label %for.body26

for.body26:                                       ; preds = %for.cond24
  %arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv77
  %11 = load i32, ptr %arrayidx29, align 4, !tbaa !5
  %add30 = add nsw i32 %11, %t.0
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  br label %for.cond24

for.cond34:                                       ; preds = %for.cond24, %for.body36
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.body36 ], [ %indvars.iv82, %for.cond24 ]
  %t.1 = phi i32 [ %add40, %for.body36 ], [ %t.0, %for.cond24 ]
  %exitcond88.not = icmp eq i64 %indvars.iv84, %wide.trip.count87
  br i1 %exitcond88.not, label %for.end43, label %for.body36

for.body36:                                       ; preds = %for.cond34
  %arrayidx39 = getelementptr inbounds i32, ptr %arrayidx15, i64 %indvars.iv84
  %12 = load i32, ptr %arrayidx39, align 4, !tbaa !5
  %add40 = add nsw i32 %12, %t.1
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  br label %for.cond34

for.end43:                                        ; preds = %for.cond34
  %spec.select = call i32 @llvm.smax.i32(i32 %t.1, i32 %ans.1)
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  br label %for.cond21

for.end47:                                        ; preds = %for.cond21
  %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.1) #6
  call void @llvm.stackrestore.p0(ptr %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: minsize nofree nounwind optsize
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: minsize nofree nounwind optsize
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

attributes #0 = { minsize nofree nounwind optsize uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { minsize nofree nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { minsize optsize }

!llvm.linker.options = !{}
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
