import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[][] a = new int[2][n];
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = Integer.parseInt(sc.next());
            }
        }

        // 主処理
        int[][] dp = new int[2][n];
        for (int i = 0; i < 2; i++) {
            int pre = 0;
            for (int j = 0; j < n; j++) {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            }
        }
        int result = dp[1][n - 1];

        // 出力
        System.out.println(result);
        sc.close();
    }
} import java.util.*; util.* java public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[][] a = new int[2][n];
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = Integer.parseInt(sc.next());
            }
        }

        // 主処理
        int[][] dp = new int[2][n];
        for (int i = 0; i < 2; i++) {
            int pre = 0;
            for (int j = 0; j < n; j++) {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            }
        }
        int result = dp[1][n - 1];

        // 出力
        System.out.println(result);
        sc.close();
    }
} Main public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[][] a = new int[2][n];
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = Integer.parseInt(sc.next());
            }
        }

        // 主処理
        int[][] dp = new int[2][n];
        for (int i = 0; i < 2; i++) {
            int pre = 0;
            for (int j = 0; j < n; j++) {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            }
        }
        int result = dp[1][n - 1];

        // 出力
        System.out.println(result);
        sc.close();
    } main {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[][] a = new int[2][n];
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = Integer.parseInt(sc.next());
            }
        }

        // 主処理
        int[][] dp = new int[2][n];
        for (int i = 0; i < 2; i++) {
            int pre = 0;
            for (int j = 0; j < n; j++) {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            }
        }
        int result = dp[1][n - 1];

        // 出力
        System.out.println(result);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc 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] = Integer.parseInt(sc.next());
            }
        } 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] = Integer.parseInt(sc.next());
            }
        } {
            for (int j = 0; j < n; j++) {
                a[i][j] = Integer.parseInt(sc.next());
            }
        } for (int j = 0; j < n; j++) {
                a[i][j] = Integer.parseInt(sc.next());
            } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                a[i][j] = Integer.parseInt(sc.next());
            } {
                a[i][j] = Integer.parseInt(sc.next());
            } a[i][j] = Integer.parseInt(sc.next()) a[i][j] a[i] a i j Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[][] dp = new int[2][n]; dp new int[2][n] 2 n for (int i = 0; i < 2; i++) {
            int pre = 0;
            for (int j = 0; j < n; j++) {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            }
        } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
            int pre = 0;
            for (int j = 0; j < n; j++) {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            }
        } {
            int pre = 0;
            for (int j = 0; j < n; j++) {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            }
        } int pre = 0; pre 0 for (int j = 0; j < n; j++) {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            } {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            } if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                } i == 0 i 0 {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } dp[i][j] = a[i][j] + pre dp[i][j] dp[i] dp i j a[i][j] + pre a[i][j] a[i] a i j pre pre = dp[i][j] pre dp[i][j] dp[i] dp i j {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                } dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]) dp[i][j] dp[i] dp i j Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]) Math.max Math a[i][j] + pre a[i][j] a[i] a i j pre a[i][j] + dp[i - 1][j] a[i][j] a[i] a i j dp[i - 1][j] dp[i - 1] dp i - 1 i 1 j pre = dp[i][j] pre dp[i][j] dp[i] dp i j int result = dp[1][n - 1]; result dp[1][n - 1] dp[1] dp 1 n - 1 n 1 System.out.println(result) System.out.println System.out System System.out result sc.close() sc.close sc String args[] args public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[][] a = new int[2][n];
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = Integer.parseInt(sc.next());
            }
        }

        // 主処理
        int[][] dp = new int[2][n];
        for (int i = 0; i < 2; i++) {
            int pre = 0;
            for (int j = 0; j < n; j++) {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            }
        }
        int result = dp[1][n - 1];

        // 出力
        System.out.println(result);
        sc.close();
    }
} public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[][] a = new int[2][n];
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = Integer.parseInt(sc.next());
            }
        }

        // 主処理
        int[][] dp = new int[2][n];
        for (int i = 0; i < 2; i++) {
            int pre = 0;
            for (int j = 0; j < n; j++) {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            }
        }
        int result = dp[1][n - 1];

        // 出力
        System.out.println(result);
        sc.close();
    }
} Main
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[][] a = new int[2][n];
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = Integer.parseInt(sc.next());
            }
        }

        // 主処理
        int[][] dp = new int[2][n];
        for (int i = 0; i < 2; i++) {
            int pre = 0;
            for (int j = 0; j < n; j++) {
                if (i == 0) {
                    dp[i][j] = a[i][j] + pre;
                    pre = dp[i][j];
                } else {
                    dp[i][j] = Math.max(a[i][j] + pre, a[i][j] + dp[i - 1][j]);
                    pre = dp[i][j];
                }
            }
        }
        int result = dp[1][n - 1];

        // 出力
        System.out.println(result);
        sc.close();
    }
}
