import java.util.Scanner;

class Solver {

    private final int[][] A;
    private final int N;

    Solver(Scanner in){
        N = in.nextInt();
        A = new int[2][N];
        for (int[] ints : A) {
            for (int i = 0; i < ints.length; i++) {
                ints[i] = in.nextInt();
            }
        }
    }

    void solve() {
        int a = A[0][0];
        int b = 0;
        int bsum = A[1][0];
        int max = a;
        for (int i = 1; i < N; i++) {
            a += A[0][i];
            b -= A[1][i-1];
            bsum += A[1][i];
            max = Math.max(a + b, max);
        }
        System.out.println(max + bsum);
    }
}

class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        new Solver(in).solve();

        in.close();
    }
} import java.util.Scanner; Scanner java.util class Solver {

    private final int[][] A;
    private final int N;

    Solver(Scanner in){
        N = in.nextInt();
        A = new int[2][N];
        for (int[] ints : A) {
            for (int i = 0; i < ints.length; i++) {
                ints[i] = in.nextInt();
            }
        }
    }

    void solve() {
        int a = A[0][0];
        int b = 0;
        int bsum = A[1][0];
        int max = a;
        for (int i = 1; i < N; i++) {
            a += A[0][i];
            b -= A[1][i-1];
            bsum += A[1][i];
            max = Math.max(a + b, max);
        }
        System.out.println(max + bsum);
    }
} Solver private final int[][] A; A private final int N; N Solver(Scanner in){
        N = in.nextInt();
        A = new int[2][N];
        for (int[] ints : A) {
            for (int i = 0; i < ints.length; i++) {
                ints[i] = in.nextInt();
            }
        }
    } Solver {
        N = in.nextInt();
        A = new int[2][N];
        for (int[] ints : A) {
            for (int i = 0; i < ints.length; i++) {
                ints[i] = in.nextInt();
            }
        }
    } N = in.nextInt() N in.nextInt() in.nextInt in A = new int[2][N] A new int[2][N] 2 N for (int[] ints : A) {
            for (int i = 0; i < ints.length; i++) {
                ints[i] = in.nextInt();
            }
        } int[] ints A {
            for (int i = 0; i < ints.length; i++) {
                ints[i] = in.nextInt();
            }
        } {
            for (int i = 0; i < ints.length; i++) {
                ints[i] = in.nextInt();
            }
        } for (int i = 0; i < ints.length; i++) {
                ints[i] = in.nextInt();
            } int i = 0; int i = 0; i 0 i < ints.length i ints.length ints ints.length i++ i++ i {
                ints[i] = in.nextInt();
            } {
                ints[i] = in.nextInt();
            } ints[i] = in.nextInt() ints[i] ints i in.nextInt() in.nextInt in Scanner in in void solve() {
        int a = A[0][0];
        int b = 0;
        int bsum = A[1][0];
        int max = a;
        for (int i = 1; i < N; i++) {
            a += A[0][i];
            b -= A[1][i-1];
            bsum += A[1][i];
            max = Math.max(a + b, max);
        }
        System.out.println(max + bsum);
    } solve {
        int a = A[0][0];
        int b = 0;
        int bsum = A[1][0];
        int max = a;
        for (int i = 1; i < N; i++) {
            a += A[0][i];
            b -= A[1][i-1];
            bsum += A[1][i];
            max = Math.max(a + b, max);
        }
        System.out.println(max + bsum);
    } int a = A[0][0]; a A[0][0] A[0] A 0 0 int b = 0; b 0 int bsum = A[1][0]; bsum A[1][0] A[1] A 1 0 int max = a; max a for (int i = 1; i < N; i++) {
            a += A[0][i];
            b -= A[1][i-1];
            bsum += A[1][i];
            max = Math.max(a + b, max);
        } int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
            a += A[0][i];
            b -= A[1][i-1];
            bsum += A[1][i];
            max = Math.max(a + b, max);
        } {
            a += A[0][i];
            b -= A[1][i-1];
            bsum += A[1][i];
            max = Math.max(a + b, max);
        } a += A[0][i] a A[0][i] A[0] A 0 i b -= A[1][i-1] b A[1][i-1] A[1] A 1 i-1 i 1 bsum += A[1][i] bsum A[1][i] A[1] A 1 i max = Math.max(a + b, max) max Math.max(a + b, max) Math.max Math a + b a b max System.out.println(max + bsum) System.out.println System.out System System.out max + bsum max bsum class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        new Solver(in).solve();

        in.close();
    }
} Main public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        new Solver(in).solve();

        in.close();
    } main {
        Scanner in = new Scanner(System.in);

        new Solver(in).solve();

        in.close();
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) new Solver(in).solve() new Solver(in).solve new Solver(in) in.close() in.close in String[] args args
import java.util.Scanner;

class Solver {

    private final int[][] A;
    private final int N;

    Solver(Scanner in){
        N = in.nextInt();
        A = new int[2][N];
        for (int[] ints : A) {
            for (int i = 0; i < ints.length; i++) {
                ints[i] = in.nextInt();
            }
        }
    }

    void solve() {
        int a = A[0][0];
        int b = 0;
        int bsum = A[1][0];
        int max = a;
        for (int i = 1; i < N; i++) {
            a += A[0][i];
            b -= A[1][i-1];
            bsum += A[1][i];
            max = Math.max(a + b, max);
        }
        System.out.println(max + bsum);
    }
}

class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        new Solver(in).solve();

        in.close();
    }
}