import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] candy = new int[2][n];

        for(int i=0;i<n;i++)candy[0][i]=sc.nextInt();
        for(int i=0;i<n;i++)candy[1][i]=sc.nextInt();

        int[] leftsum = new int[n];
        int[] rightsum = new int[n];

        leftsum[0]=candy[0][0];
        for(int i=1;i<n;i++){
            leftsum[i]=leftsum[i-1]+candy[0][i];
        }
        rightsum[n-1]=candy[1][n-1];
        for(int i=n-2;i>-1;i--){
            rightsum[i]=rightsum[i+1]+candy[1][i];
        }

        int ans=0;
        for(int i=0;i<n;i++){
            ans=Math.max(ans,leftsum[i]+rightsum[i]);
        }
        System.out.println(ans);

    }

}

 import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] candy = new int[2][n];

        for(int i=0;i<n;i++)candy[0][i]=sc.nextInt();
        for(int i=0;i<n;i++)candy[1][i]=sc.nextInt();

        int[] leftsum = new int[n];
        int[] rightsum = new int[n];

        leftsum[0]=candy[0][0];
        for(int i=1;i<n;i++){
            leftsum[i]=leftsum[i-1]+candy[0][i];
        }
        rightsum[n-1]=candy[1][n-1];
        for(int i=n-2;i>-1;i--){
            rightsum[i]=rightsum[i+1]+candy[1][i];
        }

        int ans=0;
        for(int i=0;i<n;i++){
            ans=Math.max(ans,leftsum[i]+rightsum[i]);
        }
        System.out.println(ans);

    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] candy = new int[2][n];

        for(int i=0;i<n;i++)candy[0][i]=sc.nextInt();
        for(int i=0;i<n;i++)candy[1][i]=sc.nextInt();

        int[] leftsum = new int[n];
        int[] rightsum = new int[n];

        leftsum[0]=candy[0][0];
        for(int i=1;i<n;i++){
            leftsum[i]=leftsum[i-1]+candy[0][i];
        }
        rightsum[n-1]=candy[1][n-1];
        for(int i=n-2;i>-1;i--){
            rightsum[i]=rightsum[i+1]+candy[1][i];
        }

        int ans=0;
        for(int i=0;i<n;i++){
            ans=Math.max(ans,leftsum[i]+rightsum[i]);
        }
        System.out.println(ans);

    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] candy = new int[2][n];

        for(int i=0;i<n;i++)candy[0][i]=sc.nextInt();
        for(int i=0;i<n;i++)candy[1][i]=sc.nextInt();

        int[] leftsum = new int[n];
        int[] rightsum = new int[n];

        leftsum[0]=candy[0][0];
        for(int i=1;i<n;i++){
            leftsum[i]=leftsum[i-1]+candy[0][i];
        }
        rightsum[n-1]=candy[1][n-1];
        for(int i=n-2;i>-1;i--){
            rightsum[i]=rightsum[i+1]+candy[1][i];
        }

        int ans=0;
        for(int i=0;i<n;i++){
            ans=Math.max(ans,leftsum[i]+rightsum[i]);
        }
        System.out.println(ans);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[][] candy = new int[2][n]; candy new int[2][n] 2 n for(int i=0;i<n;i++)candy[0][i]=sc.nextInt(); int i=0; int i=0; i 0 i<n i n i++ i++ i candy[0][i]=sc.nextInt(); candy[0][i]=sc.nextInt() candy[0][i] candy[0] candy 0 i sc.nextInt() sc.nextInt sc for(int i=0;i<n;i++)candy[1][i]=sc.nextInt(); int i=0; int i=0; i 0 i<n i n i++ i++ i candy[1][i]=sc.nextInt(); candy[1][i]=sc.nextInt() candy[1][i] candy[1] candy 1 i sc.nextInt() sc.nextInt sc int[] leftsum = new int[n]; leftsum new int[n] n int[] rightsum = new int[n]; rightsum new int[n] n leftsum[0]=candy[0][0] leftsum[0] leftsum 0 candy[0][0] candy[0] candy 0 0 for(int i=1;i<n;i++){
            leftsum[i]=leftsum[i-1]+candy[0][i];
        } int i=1; int i=1; i 1 i<n i n i++ i++ i {
            leftsum[i]=leftsum[i-1]+candy[0][i];
        } {
            leftsum[i]=leftsum[i-1]+candy[0][i];
        } leftsum[i]=leftsum[i-1]+candy[0][i] leftsum[i] leftsum i leftsum[i-1]+candy[0][i] leftsum[i-1] leftsum i-1 i 1 candy[0][i] candy[0] candy 0 i rightsum[n-1]=candy[1][n-1] rightsum[n-1] rightsum n-1 n 1 candy[1][n-1] candy[1] candy 1 n-1 n 1 for(int i=n-2;i>-1;i--){
            rightsum[i]=rightsum[i+1]+candy[1][i];
        } int i=n-2; int i=n-2; i n-2 n 2 i>-1 i -1 1 i-- i-- i {
            rightsum[i]=rightsum[i+1]+candy[1][i];
        } {
            rightsum[i]=rightsum[i+1]+candy[1][i];
        } rightsum[i]=rightsum[i+1]+candy[1][i] rightsum[i] rightsum i rightsum[i+1]+candy[1][i] rightsum[i+1] rightsum i+1 i 1 candy[1][i] candy[1] candy 1 i int ans=0; ans 0 for(int i=0;i<n;i++){
            ans=Math.max(ans,leftsum[i]+rightsum[i]);
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            ans=Math.max(ans,leftsum[i]+rightsum[i]);
        } {
            ans=Math.max(ans,leftsum[i]+rightsum[i]);
        } ans=Math.max(ans,leftsum[i]+rightsum[i]) ans Math.max(ans,leftsum[i]+rightsum[i]) Math.max Math ans leftsum[i]+rightsum[i] leftsum[i] leftsum i rightsum[i] rightsum i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] candy = new int[2][n];

        for(int i=0;i<n;i++)candy[0][i]=sc.nextInt();
        for(int i=0;i<n;i++)candy[1][i]=sc.nextInt();

        int[] leftsum = new int[n];
        int[] rightsum = new int[n];

        leftsum[0]=candy[0][0];
        for(int i=1;i<n;i++){
            leftsum[i]=leftsum[i-1]+candy[0][i];
        }
        rightsum[n-1]=candy[1][n-1];
        for(int i=n-2;i>-1;i--){
            rightsum[i]=rightsum[i+1]+candy[1][i];
        }

        int ans=0;
        for(int i=0;i<n;i++){
            ans=Math.max(ans,leftsum[i]+rightsum[i]);
        }
        System.out.println(ans);

    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] candy = new int[2][n];

        for(int i=0;i<n;i++)candy[0][i]=sc.nextInt();
        for(int i=0;i<n;i++)candy[1][i]=sc.nextInt();

        int[] leftsum = new int[n];
        int[] rightsum = new int[n];

        leftsum[0]=candy[0][0];
        for(int i=1;i<n;i++){
            leftsum[i]=leftsum[i-1]+candy[0][i];
        }
        rightsum[n-1]=candy[1][n-1];
        for(int i=n-2;i>-1;i--){
            rightsum[i]=rightsum[i+1]+candy[1][i];
        }

        int ans=0;
        for(int i=0;i<n;i++){
            ans=Math.max(ans,leftsum[i]+rightsum[i]);
        }
        System.out.println(ans);

    }

} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] candy = new int[2][n];

        for(int i=0;i<n;i++)candy[0][i]=sc.nextInt();
        for(int i=0;i<n;i++)candy[1][i]=sc.nextInt();

        int[] leftsum = new int[n];
        int[] rightsum = new int[n];

        leftsum[0]=candy[0][0];
        for(int i=1;i<n;i++){
            leftsum[i]=leftsum[i-1]+candy[0][i];
        }
        rightsum[n-1]=candy[1][n-1];
        for(int i=n-2;i>-1;i--){
            rightsum[i]=rightsum[i+1]+candy[1][i];
        }

        int ans=0;
        for(int i=0;i<n;i++){
            ans=Math.max(ans,leftsum[i]+rightsum[i]);
        }
        System.out.println(ans);

    }

}


