import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Scanner;

public class Main {
    //    static String INPUT = "5\n3 2 2 4 1\n1 2 2 2 1";
    static String INPUT = "";

    public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int n = scanner.nextInt();
        int[][] matrix = new int[2][];
        for (int i = 0; i < 2; i++) {
            matrix[i] = new int[n];
            for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            }
        }

        System.out.println(solve(matrix));
    }

    static int solve(int[][] matrix) {
        return dfs(matrix, 0, 0, 0);
    }

    static int dfs(int[][] matrix, int x, int y, int acc) {
        if (y >= matrix.length || x >= matrix[0].length) {
            return acc;
        }
        if (y == matrix.length - 1 && x == matrix[0].length - 1) {
            return acc + matrix[y][x];
        }
        int max = -1;
        int accPlusCurrent = acc + matrix[y][x];
        max = Math.max(max, dfs(matrix, x, y + 1, accPlusCurrent));
        max = Math.max(max, dfs(matrix, x + 1, y, accPlusCurrent));
        return max;
    }

} import java.io.ByteArrayInputStream; ByteArrayInputStream java.io import java.io.InputStream; InputStream java.io import java.util.Scanner; Scanner java.util public class Main {
    //    static String INPUT = "5\n3 2 2 4 1\n1 2 2 2 1";
    static String INPUT = "";

    public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int n = scanner.nextInt();
        int[][] matrix = new int[2][];
        for (int i = 0; i < 2; i++) {
            matrix[i] = new int[n];
            for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            }
        }

        System.out.println(solve(matrix));
    }

    static int solve(int[][] matrix) {
        return dfs(matrix, 0, 0, 0);
    }

    static int dfs(int[][] matrix, int x, int y, int acc) {
        if (y >= matrix.length || x >= matrix[0].length) {
            return acc;
        }
        if (y == matrix.length - 1 && x == matrix[0].length - 1) {
            return acc + matrix[y][x];
        }
        int max = -1;
        int accPlusCurrent = acc + matrix[y][x];
        max = Math.max(max, dfs(matrix, x, y + 1, accPlusCurrent));
        max = Math.max(max, dfs(matrix, x + 1, y, accPlusCurrent));
        return max;
    }

} Main //    static String INPUT = "5\n3 2 2 4 1\n1 2 2 2 1";
    static String INPUT = ""; INPUT "" public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int n = scanner.nextInt();
        int[][] matrix = new int[2][];
        for (int i = 0; i < 2; i++) {
            matrix[i] = new int[n];
            for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            }
        }

        System.out.println(solve(matrix));
    } main {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int n = scanner.nextInt();
        int[][] matrix = new int[2][];
        for (int i = 0; i < 2; i++) {
            matrix[i] = new int[n];
            for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            }
        }

        System.out.println(solve(matrix));
    } InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes()); is INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes()) INPUT.isEmpty() INPUT.isEmpty INPUT System.in System System.in new ByteArrayInputStream(INPUT.getBytes()) Scanner scanner = new Scanner(is); scanner new Scanner(is) final int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int[][] matrix = new int[2][]; matrix new int[2][] 2 for (int i = 0; i < 2; i++) {
            matrix[i] = new int[n];
            for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            }
        } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
            matrix[i] = new int[n];
            for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            }
        } {
            matrix[i] = new int[n];
            for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            }
        } matrix[i] = new int[n] matrix[i] matrix i new int[n] n for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                matrix[i][j] = scanner.nextInt();
            } {
                matrix[i][j] = scanner.nextInt();
            } matrix[i][j] = scanner.nextInt() matrix[i][j] matrix[i] matrix i j scanner.nextInt() scanner.nextInt scanner System.out.println(solve(matrix)) System.out.println System.out System System.out solve(matrix) solve matrix String[] args args static int solve(int[][] matrix) {
        return dfs(matrix, 0, 0, 0);
    } solve {
        return dfs(matrix, 0, 0, 0);
    } return dfs(matrix, 0, 0, 0); dfs(matrix, 0, 0, 0) dfs matrix 0 0 0 int[][] matrix matrix static int dfs(int[][] matrix, int x, int y, int acc) {
        if (y >= matrix.length || x >= matrix[0].length) {
            return acc;
        }
        if (y == matrix.length - 1 && x == matrix[0].length - 1) {
            return acc + matrix[y][x];
        }
        int max = -1;
        int accPlusCurrent = acc + matrix[y][x];
        max = Math.max(max, dfs(matrix, x, y + 1, accPlusCurrent));
        max = Math.max(max, dfs(matrix, x + 1, y, accPlusCurrent));
        return max;
    } dfs {
        if (y >= matrix.length || x >= matrix[0].length) {
            return acc;
        }
        if (y == matrix.length - 1 && x == matrix[0].length - 1) {
            return acc + matrix[y][x];
        }
        int max = -1;
        int accPlusCurrent = acc + matrix[y][x];
        max = Math.max(max, dfs(matrix, x, y + 1, accPlusCurrent));
        max = Math.max(max, dfs(matrix, x + 1, y, accPlusCurrent));
        return max;
    } if (y >= matrix.length || x >= matrix[0].length) {
            return acc;
        } y >= matrix.length || x >= matrix[0].length y >= matrix.length y matrix.length matrix matrix.length x >= matrix[0].length x matrix[0].length matrix[0] matrix 0 matrix[0].length {
            return acc;
        } return acc; acc if (y == matrix.length - 1 && x == matrix[0].length - 1) {
            return acc + matrix[y][x];
        } y == matrix.length - 1 && x == matrix[0].length - 1 y == matrix.length - 1 y matrix.length - 1 matrix.length matrix matrix.length 1 x == matrix[0].length - 1 x matrix[0].length - 1 matrix[0].length matrix[0] matrix 0 matrix[0].length 1 {
            return acc + matrix[y][x];
        } return acc + matrix[y][x]; acc + matrix[y][x] acc matrix[y][x] matrix[y] matrix y x int max = -1; max -1 1 int accPlusCurrent = acc + matrix[y][x]; accPlusCurrent acc + matrix[y][x] acc matrix[y][x] matrix[y] matrix y x max = Math.max(max, dfs(matrix, x, y + 1, accPlusCurrent)) max Math.max(max, dfs(matrix, x, y + 1, accPlusCurrent)) Math.max Math max dfs(matrix, x, y + 1, accPlusCurrent) dfs matrix x y + 1 y 1 accPlusCurrent max = Math.max(max, dfs(matrix, x + 1, y, accPlusCurrent)) max Math.max(max, dfs(matrix, x + 1, y, accPlusCurrent)) Math.max Math max dfs(matrix, x + 1, y, accPlusCurrent) dfs matrix x + 1 x 1 y accPlusCurrent return max; max int[][] matrix matrix int x x int y y int acc acc public class Main {
    //    static String INPUT = "5\n3 2 2 4 1\n1 2 2 2 1";
    static String INPUT = "";

    public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int n = scanner.nextInt();
        int[][] matrix = new int[2][];
        for (int i = 0; i < 2; i++) {
            matrix[i] = new int[n];
            for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            }
        }

        System.out.println(solve(matrix));
    }

    static int solve(int[][] matrix) {
        return dfs(matrix, 0, 0, 0);
    }

    static int dfs(int[][] matrix, int x, int y, int acc) {
        if (y >= matrix.length || x >= matrix[0].length) {
            return acc;
        }
        if (y == matrix.length - 1 && x == matrix[0].length - 1) {
            return acc + matrix[y][x];
        }
        int max = -1;
        int accPlusCurrent = acc + matrix[y][x];
        max = Math.max(max, dfs(matrix, x, y + 1, accPlusCurrent));
        max = Math.max(max, dfs(matrix, x + 1, y, accPlusCurrent));
        return max;
    }

} public class Main {
    //    static String INPUT = "5\n3 2 2 4 1\n1 2 2 2 1";
    static String INPUT = "";

    public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int n = scanner.nextInt();
        int[][] matrix = new int[2][];
        for (int i = 0; i < 2; i++) {
            matrix[i] = new int[n];
            for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            }
        }

        System.out.println(solve(matrix));
    }

    static int solve(int[][] matrix) {
        return dfs(matrix, 0, 0, 0);
    }

    static int dfs(int[][] matrix, int x, int y, int acc) {
        if (y >= matrix.length || x >= matrix[0].length) {
            return acc;
        }
        if (y == matrix.length - 1 && x == matrix[0].length - 1) {
            return acc + matrix[y][x];
        }
        int max = -1;
        int accPlusCurrent = acc + matrix[y][x];
        max = Math.max(max, dfs(matrix, x, y + 1, accPlusCurrent));
        max = Math.max(max, dfs(matrix, x + 1, y, accPlusCurrent));
        return max;
    }

} Main
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Scanner;

public class Main {
    //    static String INPUT = "5\n3 2 2 4 1\n1 2 2 2 1";
    static String INPUT = "";

    public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int n = scanner.nextInt();
        int[][] matrix = new int[2][];
        for (int i = 0; i < 2; i++) {
            matrix[i] = new int[n];
            for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            }
        }

        System.out.println(solve(matrix));
    }

    static int solve(int[][] matrix) {
        return dfs(matrix, 0, 0, 0);
    }

    static int dfs(int[][] matrix, int x, int y, int acc) {
        if (y >= matrix.length || x >= matrix[0].length) {
            return acc;
        }
        if (y == matrix.length - 1 && x == matrix[0].length - 1) {
            return acc + matrix[y][x];
        }
        int max = -1;
        int accPlusCurrent = acc + matrix[y][x];
        max = Math.max(max, dfs(matrix, x, y + 1, accPlusCurrent));
        max = Math.max(max, dfs(matrix, x + 1, y, accPlusCurrent));
        return max;
    }

}
