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];

        dp[0][0] = a[0][0];
        for (int i = 1; i < n; i++) {
            dp[0][i] = dp[0][i - 1] + a[0][i];
        }

        dp[1][0] = dp[0][0] + a[1][0];
        for (int i = 1; i < n; i++) {
            dp[1][i] = Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]);
        }

        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];

        dp[0][0] = a[0][0];
        for (int i = 1; i < n; i++) {
            dp[0][i] = dp[0][i - 1] + a[0][i];
        }

        dp[1][0] = dp[0][0] + a[1][0];
        for (int i = 1; i < n; i++) {
            dp[1][i] = Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]);
        }

        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];

        dp[0][0] = a[0][0];
        for (int i = 1; i < n; i++) {
            dp[0][i] = dp[0][i - 1] + a[0][i];
        }

        dp[1][0] = dp[0][0] + a[1][0];
        for (int i = 1; i < n; i++) {
            dp[1][i] = Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]);
        }

        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];

        dp[0][0] = a[0][0];
        for (int i = 1; i < n; i++) {
            dp[0][i] = dp[0][i - 1] + a[0][i];
        }

        dp[1][0] = dp[0][0] + a[1][0];
        for (int i = 1; i < n; i++) {
            dp[1][i] = Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]);
        }

        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 dp[0][0] = a[0][0] dp[0][0] dp[0] dp 0 0 a[0][0] a[0] a 0 0 for (int i = 1; i < n; i++) {
            dp[0][i] = dp[0][i - 1] + a[0][i];
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            dp[0][i] = dp[0][i - 1] + a[0][i];
        } {
            dp[0][i] = dp[0][i - 1] + a[0][i];
        } dp[0][i] = dp[0][i - 1] + a[0][i] dp[0][i] dp[0] dp 0 i dp[0][i - 1] + a[0][i] dp[0][i - 1] dp[0] dp 0 i - 1 i 1 a[0][i] a[0] a 0 i dp[1][0] = dp[0][0] + a[1][0] dp[1][0] dp[1] dp 1 0 dp[0][0] + a[1][0] dp[0][0] dp[0] dp 0 0 a[1][0] a[1] a 1 0 for (int i = 1; i < n; i++) {
            dp[1][i] = Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]);
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            dp[1][i] = Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]);
        } {
            dp[1][i] = Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]);
        } dp[1][i] = Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]) dp[1][i] dp[1] dp 1 i Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]) Math.max Math dp[1][i - 1] + a[1][i] dp[1][i - 1] dp[1] dp 1 i - 1 i 1 a[1][i] a[1] a 1 i dp[0][i] + a[1][i] dp[0][i] dp[0] dp 0 i a[1][i] a[1] a 1 i 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];

        dp[0][0] = a[0][0];
        for (int i = 1; i < n; i++) {
            dp[0][i] = dp[0][i - 1] + a[0][i];
        }

        dp[1][0] = dp[0][0] + a[1][0];
        for (int i = 1; i < n; i++) {
            dp[1][i] = Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]);
        }

        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];

        dp[0][0] = a[0][0];
        for (int i = 1; i < n; i++) {
            dp[0][i] = dp[0][i - 1] + a[0][i];
        }

        dp[1][0] = dp[0][0] + a[1][0];
        for (int i = 1; i < n; i++) {
            dp[1][i] = Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]);
        }

        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];

        dp[0][0] = a[0][0];
        for (int i = 1; i < n; i++) {
            dp[0][i] = dp[0][i - 1] + a[0][i];
        }

        dp[1][0] = dp[0][0] + a[1][0];
        for (int i = 1; i < n; i++) {
            dp[1][i] = Math.max(dp[1][i - 1] + a[1][i], dp[0][i] + a[1][i]);
        }

        int result = dp[1][n - 1];

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