#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: nofree nounwind 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) #6
  %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
  %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
  %4 = load i32, ptr %n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  call void @llvm.assume(i1 %5)
  br label %for.body3

for.body3:                                        ; preds = %entry, %for.body3
  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %entry ]
  %arrayidx5 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
  %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %6 = load i32, ptr %n, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %cmp2 = icmp slt i64 %indvars.iv.next, %7
  br i1 %cmp2, label %for.body3, label %for.inc7

for.inc7:                                         ; preds = %for.body3
  %cmp269.1 = icmp sgt i32 %6, 0
  br i1 %cmp269.1, label %for.body3.lr.ph.1, label %for.end9.thread112

for.end9.thread112:                               ; preds = %for.inc7
  %.pre113 = load i32, ptr %vla, align 16, !tbaa !5
  br label %for.end47

for.body3.lr.ph.1:                                ; preds = %for.inc7
  %arrayidx.1 = getelementptr inbounds i32, ptr %vla, i64 %1
  br label %for.body3.1

for.body3.1:                                      ; preds = %for.body3.1, %for.body3.lr.ph.1
  %indvars.iv.1 = phi i64 [ 0, %for.body3.lr.ph.1 ], [ %indvars.iv.next.1, %for.body3.1 ]
  %arrayidx5.1 = getelementptr inbounds i32, ptr %arrayidx.1, i64 %indvars.iv.1
  %call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %8 = load i32, ptr %n, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %cmp2.1 = icmp slt i64 %indvars.iv.next.1, %9
  br i1 %cmp2.1, label %for.body3.1, label %for.end9

for.end9:                                         ; preds = %for.body3.1
  %.pre = load i32, ptr %vla, align 16, !tbaa !5
  %cmp1372 = icmp sgt i32 %8, 0
  br i1 %cmp1372, label %for.body14.lr.ph, label %for.end47

for.body14.lr.ph:                                 ; preds = %for.end9
  %arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %1
  %wide.trip.count = zext i32 %8 to i64
  %min.iters.check = icmp ult i32 %8, 8
  br i1 %min.iters.check, label %for.body14.preheader, label %vector.ph

vector.ph:                                        ; preds = %for.body14.lr.ph
  %n.vec = and i64 %wide.trip.count, 4294967288
  %10 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.pre, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %10, %vector.ph ], [ %13, %vector.body ]
  %vec.phi119 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
  %11 = getelementptr inbounds i32, ptr %arrayidx15, i64 %index
  %wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5
  %12 = getelementptr inbounds i32, ptr %11, i64 4
  %wide.load120 = load <4 x i32>, ptr %12, align 4, !tbaa !5
  %13 = add <4 x i32> %wide.load, %vec.phi
  %14 = add <4 x i32> %wide.load120, %vec.phi119
  %index.next = add nuw i64 %index, 8
  %15 = icmp eq i64 %index.next, %n.vec
  br i1 %15, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %14, %13
  %16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %for.cond21.preheader, label %for.body14.preheader

for.body14.preheader:                             ; preds = %for.body14.lr.ph, %middle.block
  %indvars.iv91.ph = phi i64 [ 0, %for.body14.lr.ph ], [ %n.vec, %middle.block ]
  %ans.073.ph = phi i32 [ %.pre, %for.body14.lr.ph ], [ %16, %middle.block ]
  br label %for.body14

for.cond21.preheader:                             ; preds = %for.body14, %middle.block
  %add.lcssa = phi i32 [ %16, %middle.block ], [ %add, %for.body14 ]
  %cmp2282 = icmp sgt i32 %8, 1
  br i1 %cmp2282, label %for.cond24.preheader.lr.ph, label %for.end47

for.cond24.preheader.lr.ph:                       ; preds = %for.cond21.preheader
  %arrayidx37 = getelementptr inbounds i32, ptr %vla, i64 %1
  %17 = add nsw i32 %8, -1
  %wide.trip.count109 = zext i32 %17 to i64
  %wide.trip.count104 = zext i32 %8 to i64
  br label %for.cond24.preheader

for.body14:                                       ; preds = %for.body14.preheader, %for.body14
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.body14 ], [ %indvars.iv91.ph, %for.body14.preheader ]
  %ans.073 = phi i32 [ %add, %for.body14 ], [ %ans.073.ph, %for.body14.preheader ]
  %arrayidx17 = getelementptr inbounds i32, ptr %arrayidx15, i64 %indvars.iv91
  %18 = load i32, ptr %arrayidx17, align 4, !tbaa !5
  %add = add nsw i32 %18, %ans.073
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count
  br i1 %exitcond.not, label %for.cond21.preheader, label %for.body14, !llvm.loop !12

for.cond24.preheader:                             ; preds = %for.cond24.preheader.lr.ph, %for.end43
  %indvars.iv106 = phi i64 [ 1, %for.cond24.preheader.lr.ph ], [ %indvars.iv.next107, %for.end43 ]
  %indvars.iv99 = phi i64 [ 0, %for.cond24.preheader.lr.ph ], [ %indvars.iv.next100, %for.end43 ]
  %ans.183 = phi i32 [ %add.lcssa, %for.cond24.preheader.lr.ph ], [ %spec.select, %for.end43 ]
  %19 = sub nsw i64 %wide.trip.count, %indvars.iv99
  %min.iters.check140 = icmp ult i64 %indvars.iv106, 8
  br i1 %min.iters.check140, label %for.body26.preheader, label %vector.ph141

vector.ph141:                                     ; preds = %for.cond24.preheader
  %n.vec143 = and i64 %indvars.iv106, 9223372036854775800
  br label %vector.body146

vector.body146:                                   ; preds = %vector.body146, %vector.ph141
  %index147 = phi i64 [ 0, %vector.ph141 ], [ %index.next152, %vector.body146 ]
  %vec.phi148 = phi <4 x i32> [ zeroinitializer, %vector.ph141 ], [ %22, %vector.body146 ]
  %vec.phi149 = phi <4 x i32> [ zeroinitializer, %vector.ph141 ], [ %23, %vector.body146 ]
  %20 = getelementptr inbounds i32, ptr %vla, i64 %index147
  %wide.load150 = load <4 x i32>, ptr %20, align 16, !tbaa !5
  %21 = getelementptr inbounds i32, ptr %20, i64 4
  %wide.load151 = load <4 x i32>, ptr %21, align 16, !tbaa !5
  %22 = add <4 x i32> %wide.load150, %vec.phi148
  %23 = add <4 x i32> %wide.load151, %vec.phi149
  %index.next152 = add nuw i64 %index147, 8
  %24 = icmp eq i64 %index.next152, %n.vec143
  br i1 %24, label %middle.block138, label %vector.body146, !llvm.loop !13

middle.block138:                                  ; preds = %vector.body146
  %bin.rdx153 = add <4 x i32> %23, %22
  %25 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx153)
  %cmp.n145 = icmp eq i64 %indvars.iv106, %n.vec143
  br i1 %cmp.n145, label %for.body36.preheader, label %for.body26.preheader

for.body26.preheader:                             ; preds = %for.cond24.preheader, %middle.block138
  %indvars.iv94.ph = phi i64 [ 0, %for.cond24.preheader ], [ %n.vec143, %middle.block138 ]
  %t.076.ph = phi i32 [ 0, %for.cond24.preheader ], [ %25, %middle.block138 ]
  br label %for.body26

for.body26:                                       ; preds = %for.body26.preheader, %for.body26
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.body26 ], [ %indvars.iv94.ph, %for.body26.preheader ]
  %t.076 = phi i32 [ %add30, %for.body26 ], [ %t.076.ph, %for.body26.preheader ]
  %arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv94
  %26 = load i32, ptr %arrayidx29, align 4, !tbaa !5
  %add30 = add nsw i32 %26, %t.076
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %exitcond98.not = icmp eq i64 %indvars.iv.next95, %indvars.iv106
  br i1 %exitcond98.not, label %for.body36.preheader, label %for.body26, !llvm.loop !14

for.body36.preheader:                             ; preds = %for.body26, %middle.block138
  %add30.lcssa = phi i32 [ %25, %middle.block138 ], [ %add30, %for.body26 ]
  %min.iters.check123 = icmp ult i64 %19, 8
  br i1 %min.iters.check123, label %for.body36.preheader155, label %vector.ph124

vector.ph124:                                     ; preds = %for.body36.preheader
  %n.vec126 = and i64 %19, -8
  %ind.end = add i64 %indvars.iv99, %n.vec126
  %27 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %add30.lcssa, i64 0
  %28 = getelementptr i32, ptr %arrayidx37, i64 %indvars.iv99
  br label %vector.body129

vector.body129:                                   ; preds = %vector.body129, %vector.ph124
  %index130 = phi i64 [ 0, %vector.ph124 ], [ %index.next135, %vector.body129 ]
  %vec.phi131 = phi <4 x i32> [ %27, %vector.ph124 ], [ %31, %vector.body129 ]
  %vec.phi132 = phi <4 x i32> [ zeroinitializer, %vector.ph124 ], [ %32, %vector.body129 ]
  %29 = getelementptr i32, ptr %28, i64 %index130
  %wide.load133 = load <4 x i32>, ptr %29, align 4, !tbaa !5
  %30 = getelementptr inbounds i32, ptr %29, i64 4
  %wide.load134 = load <4 x i32>, ptr %30, align 4, !tbaa !5
  %31 = add <4 x i32> %wide.load133, %vec.phi131
  %32 = add <4 x i32> %wide.load134, %vec.phi132
  %index.next135 = add nuw i64 %index130, 8
  %33 = icmp eq i64 %index.next135, %n.vec126
  br i1 %33, label %middle.block121, label %vector.body129, !llvm.loop !15

middle.block121:                                  ; preds = %vector.body129
  %bin.rdx136 = add <4 x i32> %32, %31
  %34 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx136)
  %cmp.n128 = icmp eq i64 %19, %n.vec126
  br i1 %cmp.n128, label %for.end43, label %for.body36.preheader155

for.body36.preheader155:                          ; preds = %for.body36.preheader, %middle.block121
  %indvars.iv101.ph = phi i64 [ %indvars.iv99, %for.body36.preheader ], [ %ind.end, %middle.block121 ]
  %t.179.ph = phi i32 [ %add30.lcssa, %for.body36.preheader ], [ %34, %middle.block121 ]
  br label %for.body36

for.body36:                                       ; preds = %for.body36.preheader155, %for.body36
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body36 ], [ %indvars.iv101.ph, %for.body36.preheader155 ]
  %t.179 = phi i32 [ %add40, %for.body36 ], [ %t.179.ph, %for.body36.preheader155 ]
  %arrayidx39 = getelementptr inbounds i32, ptr %arrayidx37, i64 %indvars.iv101
  %35 = load i32, ptr %arrayidx39, align 4, !tbaa !5
  %add40 = add nsw i32 %35, %t.179
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond105.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count104
  br i1 %exitcond105.not, label %for.end43, label %for.body36, !llvm.loop !16

for.end43:                                        ; preds = %for.body36, %middle.block121
  %add40.lcssa = phi i32 [ %34, %middle.block121 ], [ %add40, %for.body36 ]
  %spec.select = call i32 @llvm.smax.i32(i32 %add40.lcssa, i32 %ans.183)
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count109
  br i1 %exitcond110.not, label %for.end47, label %for.cond24.preheader

for.end47:                                        ; preds = %for.end43, %for.end9.thread112, %for.end9, %for.cond21.preheader
  %ans.1.lcssa = phi i32 [ %add.lcssa, %for.cond21.preheader ], [ %.pre113, %for.end9.thread112 ], [ %.pre, %for.end9 ], [ %spec.select, %for.end43 ]
  %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.1.lcssa)
  call void @llvm.stackrestore.p0(ptr %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
  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: nofree nounwind
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: nofree nounwind
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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4

attributes #0 = { nofree nounwind 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 = { nofree nounwind "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 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { nounwind }

!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"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !11, !10}
!13 = distinct !{!13, !10, !11}
!14 = distinct !{!14, !11, !10}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !11, !10}
