import java.util.*;

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

        int N = scanner.nextInt();

        int[][] A = new int[2][N];

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                A[i][j] = scanner.nextInt();
            }
        }

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            }
        }

        System.out.println(A[1][N-1]);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();

        int[][] A = new int[2][N];

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                A[i][j] = scanner.nextInt();
            }
        }

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            }
        }

        System.out.println(A[1][N-1]);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();

        int[][] A = new int[2][N];

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                A[i][j] = scanner.nextInt();
            }
        }

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            }
        }

        System.out.println(A[1][N-1]);
    } main {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();

        int[][] A = new int[2][N];

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                A[i][j] = scanner.nextInt();
            }
        }

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            }
        }

        System.out.println(A[1][N-1]);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int[][] A = new int[2][N]; A new int[2][N] 2 N for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                A[i][j] = scanner.nextInt();
            }
        } int i=0; int i=0; i 0 i<2 i 2 i++ i++ i {
            for(int j=0; j<N; j++){
                A[i][j] = scanner.nextInt();
            }
        } {
            for(int j=0; j<N; j++){
                A[i][j] = scanner.nextInt();
            }
        } for(int j=0; j<N; j++){
                A[i][j] = scanner.nextInt();
            } int j=0; int j=0; j 0 j<N j N j++ j++ j {
                A[i][j] = scanner.nextInt();
            } {
                A[i][j] = scanner.nextInt();
            } A[i][j] = scanner.nextInt() A[i][j] A[i] A i j scanner.nextInt() scanner.nextInt scanner for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            }
        } int i=0; int i=0; i 0 i<2 i 2 i++ i++ i {
            for(int j=0; j<N; j++){
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            }
        } {
            for(int j=0; j<N; j++){
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            }
        } for(int j=0; j<N; j++){
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            } int j=0; int j=0; j 0 j<N j N j++ j++ j {
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            } {
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            } if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                } i == 1 i 1 {
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                } if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    } j >=  1 j 1 {
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    } A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]) A[i][j] A[i] A i j Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]) Math.max Math A[i][j]+A[i-1][j] A[i][j] A[i] A i j A[i-1][j] A[i-1] A i-1 i 1 j A[i][j]+A[i][j-1] A[i][j] A[i] A i j A[i][j-1] A[i] A i j-1 j 1 {
                        A[i][j] =A[i][j]+A[i-1][j];
                    } A[i][j] =A[i][j]+A[i-1][j] A[i][j] A[i] A i j A[i][j]+A[i-1][j] A[i][j] A[i] A i j A[i-1][j] A[i-1] A i-1 i 1 j {
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                } if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    } j >= 1 j 1 {
                        A[i][j] = A[i][j]+ A[i][j-1];
                    } A[i][j] = A[i][j]+ A[i][j-1] A[i][j] A[i] A i j A[i][j]+ A[i][j-1] A[i][j] A[i] A i j A[i][j-1] A[i] A i j-1 j 1 System.out.println(A[1][N-1]) System.out.println System.out System System.out A[1][N-1] A[1] A 1 N-1 N 1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();

        int[][] A = new int[2][N];

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                A[i][j] = scanner.nextInt();
            }
        }

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            }
        }

        System.out.println(A[1][N-1]);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();

        int[][] A = new int[2][N];

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                A[i][j] = scanner.nextInt();
            }
        }

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            }
        }

        System.out.println(A[1][N-1]);
    }
} Main
import java.util.*;

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

        int N = scanner.nextInt();

        int[][] A = new int[2][N];

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                A[i][j] = scanner.nextInt();
            }
        }

        for(int i=0; i<2; i++){
            for(int j=0; j<N; j++){
                if(i == 1){
                    if(j >=  1){
                        A[i][j] = Math.max(A[i][j]+A[i-1][j], A[i][j]+A[i][j-1]);
                    }else{
                        A[i][j] =A[i][j]+A[i-1][j];
                    }
                }else{
                     if(j >= 1){
                        A[i][j] = A[i][j]+ A[i][j-1];
                    }
                }
            }
        }

        System.out.println(A[1][N-1]);
    }
}
