import java.util.*;

public class Main {
    static int n;
    static int a[][];

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        a = new int[2][n];

        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve(0, 0));
    }

    public static int solve(int i, int j) {
        int max = 0;

        if (i == 1 && j == n - 1) {
            max = a[i][j];
        } else if (i < 1 && j < n - 1) {
            max = Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1));
        } else if (i < 1) {
            max = a[i][j] + solve(i + 1, j);
        } else if (j < n - 1) {
            max = a[i][j] + solve(i, j + 1);
        }
        return max;
    }
} import java.util.*; util.* java public class Main {
    static int n;
    static int a[][];

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        a = new int[2][n];

        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve(0, 0));
    }

    public static int solve(int i, int j) {
        int max = 0;

        if (i == 1 && j == n - 1) {
            max = a[i][j];
        } else if (i < 1 && j < n - 1) {
            max = Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1));
        } else if (i < 1) {
            max = a[i][j] + solve(i + 1, j);
        } else if (j < n - 1) {
            max = a[i][j] + solve(i, j + 1);
        }
        return max;
    }
} Main static int n; n static int a[][]; a public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        a = new int[2][n];

        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve(0, 0));
    } main {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        a = new int[2][n];

        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve(0, 0));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc 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] = sc.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] = sc.nextInt();
            }
        } {
            for (int j = 0; j < n; j++) {
                a[i][j] = sc.nextInt();
            }
        } for (int j = 0; j < n; j++) {
                a[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                a[i][j] = sc.nextInt();
            } {
                a[i][j] = sc.nextInt();
            } a[i][j] = sc.nextInt() a[i][j] a[i] a i j sc.nextInt() sc.nextInt sc System.out.println(solve(0, 0)) System.out.println System.out System System.out solve(0, 0) solve 0 0 String[] args args public static int solve(int i, int j) {
        int max = 0;

        if (i == 1 && j == n - 1) {
            max = a[i][j];
        } else if (i < 1 && j < n - 1) {
            max = Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1));
        } else if (i < 1) {
            max = a[i][j] + solve(i + 1, j);
        } else if (j < n - 1) {
            max = a[i][j] + solve(i, j + 1);
        }
        return max;
    } solve {
        int max = 0;

        if (i == 1 && j == n - 1) {
            max = a[i][j];
        } else if (i < 1 && j < n - 1) {
            max = Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1));
        } else if (i < 1) {
            max = a[i][j] + solve(i + 1, j);
        } else if (j < n - 1) {
            max = a[i][j] + solve(i, j + 1);
        }
        return max;
    } int max = 0; max 0 if (i == 1 && j == n - 1) {
            max = a[i][j];
        } else if (i < 1 && j < n - 1) {
            max = Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1));
        } else if (i < 1) {
            max = a[i][j] + solve(i + 1, j);
        } else if (j < n - 1) {
            max = a[i][j] + solve(i, j + 1);
        } i == 1 && j == n - 1 i == 1 i 1 j == n - 1 j n - 1 n 1 {
            max = a[i][j];
        } max = a[i][j] max a[i][j] a[i] a i j if (i < 1 && j < n - 1) {
            max = Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1));
        } else if (i < 1) {
            max = a[i][j] + solve(i + 1, j);
        } else if (j < n - 1) {
            max = a[i][j] + solve(i, j + 1);
        } i < 1 && j < n - 1 i < 1 i 1 j < n - 1 j n - 1 n 1 {
            max = Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1));
        } max = Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1)) max Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1)) Math.max Math a[i][j] + solve(i + 1, j) a[i][j] a[i] a i j solve(i + 1, j) solve i + 1 i 1 j a[i][j] + solve(i, j + 1) a[i][j] a[i] a i j solve(i, j + 1) solve i j + 1 j 1 if (i < 1) {
            max = a[i][j] + solve(i + 1, j);
        } else if (j < n - 1) {
            max = a[i][j] + solve(i, j + 1);
        } i < 1 i 1 {
            max = a[i][j] + solve(i + 1, j);
        } max = a[i][j] + solve(i + 1, j) max a[i][j] + solve(i + 1, j) a[i][j] a[i] a i j solve(i + 1, j) solve i + 1 i 1 j if (j < n - 1) {
            max = a[i][j] + solve(i, j + 1);
        } j < n - 1 j n - 1 n 1 {
            max = a[i][j] + solve(i, j + 1);
        } max = a[i][j] + solve(i, j + 1) max a[i][j] + solve(i, j + 1) a[i][j] a[i] a i j solve(i, j + 1) solve i j + 1 j 1 return max; max int i i int j j public class Main {
    static int n;
    static int a[][];

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        a = new int[2][n];

        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve(0, 0));
    }

    public static int solve(int i, int j) {
        int max = 0;

        if (i == 1 && j == n - 1) {
            max = a[i][j];
        } else if (i < 1 && j < n - 1) {
            max = Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1));
        } else if (i < 1) {
            max = a[i][j] + solve(i + 1, j);
        } else if (j < n - 1) {
            max = a[i][j] + solve(i, j + 1);
        }
        return max;
    }
} public class Main {
    static int n;
    static int a[][];

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        a = new int[2][n];

        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve(0, 0));
    }

    public static int solve(int i, int j) {
        int max = 0;

        if (i == 1 && j == n - 1) {
            max = a[i][j];
        } else if (i < 1 && j < n - 1) {
            max = Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1));
        } else if (i < 1) {
            max = a[i][j] + solve(i + 1, j);
        } else if (j < n - 1) {
            max = a[i][j] + solve(i, j + 1);
        }
        return max;
    }
} Main
import java.util.*;

public class Main {
    static int n;
    static int a[][];

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        a = new int[2][n];

        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        System.out.println(solve(0, 0));
    }

    public static int solve(int i, int j) {
        int max = 0;

        if (i == 1 && j == n - 1) {
            max = a[i][j];
        } else if (i < 1 && j < n - 1) {
            max = Math.max(a[i][j] + solve(i + 1, j), a[i][j] + solve(i, j + 1));
        } else if (i < 1) {
            max = a[i][j] + solve(i + 1, j);
        } else if (j < n - 1) {
            max = a[i][j] + solve(i, j + 1);
        }
        return max;
    }
}
