import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int[] A1 = new int[N];
        int[] A2 = new int[N];
        int[] a1 = new int[N + 1];
        int[] a2 = new int[N + 1];
        Integer[] result = new Integer[N + 1];

        for (int i = 0; i < N; i++) {
            A1[i] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < N; i++) {
            A2[i] = Integer.parseInt(sc.next());
        }

        a1[0] = 0;
        a2[0] = 0;
        for (int i = 0; i < N; i++) {
            a1[i + 1] = a1[i] + A1[i];
            a2[i + 1] = a2[i] + A2[i];
        }

        result[0] = 0;
        for (int i = 1; i <= N; i++) {
            result[i] = a1[i] + a2[N] - a2[i - 1];
        }

        Arrays.sort(result, Collections.reverseOrder());

        PrintWriter out = new PrintWriter(System.out);
        out.println(result[0]);

        sc.close();
        out.flush();
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int[] A1 = new int[N];
        int[] A2 = new int[N];
        int[] a1 = new int[N + 1];
        int[] a2 = new int[N + 1];
        Integer[] result = new Integer[N + 1];

        for (int i = 0; i < N; i++) {
            A1[i] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < N; i++) {
            A2[i] = Integer.parseInt(sc.next());
        }

        a1[0] = 0;
        a2[0] = 0;
        for (int i = 0; i < N; i++) {
            a1[i + 1] = a1[i] + A1[i];
            a2[i + 1] = a2[i] + A2[i];
        }

        result[0] = 0;
        for (int i = 1; i <= N; i++) {
            result[i] = a1[i] + a2[N] - a2[i - 1];
        }

        Arrays.sort(result, Collections.reverseOrder());

        PrintWriter out = new PrintWriter(System.out);
        out.println(result[0]);

        sc.close();
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int[] A1 = new int[N];
        int[] A2 = new int[N];
        int[] a1 = new int[N + 1];
        int[] a2 = new int[N + 1];
        Integer[] result = new Integer[N + 1];

        for (int i = 0; i < N; i++) {
            A1[i] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < N; i++) {
            A2[i] = Integer.parseInt(sc.next());
        }

        a1[0] = 0;
        a2[0] = 0;
        for (int i = 0; i < N; i++) {
            a1[i + 1] = a1[i] + A1[i];
            a2[i + 1] = a2[i] + A2[i];
        }

        result[0] = 0;
        for (int i = 1; i <= N; i++) {
            result[i] = a1[i] + a2[N] - a2[i - 1];
        }

        Arrays.sort(result, Collections.reverseOrder());

        PrintWriter out = new PrintWriter(System.out);
        out.println(result[0]);

        sc.close();
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int[] A1 = new int[N];
        int[] A2 = new int[N];
        int[] a1 = new int[N + 1];
        int[] a2 = new int[N + 1];
        Integer[] result = new Integer[N + 1];

        for (int i = 0; i < N; i++) {
            A1[i] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < N; i++) {
            A2[i] = Integer.parseInt(sc.next());
        }

        a1[0] = 0;
        a2[0] = 0;
        for (int i = 0; i < N; i++) {
            a1[i + 1] = a1[i] + A1[i];
            a2[i + 1] = a2[i] + A2[i];
        }

        result[0] = 0;
        for (int i = 1; i <= N; i++) {
            result[i] = a1[i] + a2[N] - a2[i - 1];
        }

        Arrays.sort(result, Collections.reverseOrder());

        PrintWriter out = new PrintWriter(System.out);
        out.println(result[0]);

        sc.close();
        out.flush();
    } 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[] A1 = new int[N]; A1 new int[N] N int[] A2 = new int[N]; A2 new int[N] N int[] a1 = new int[N + 1]; a1 new int[N + 1] N + 1 N 1 int[] a2 = new int[N + 1]; a2 new int[N + 1] N + 1 N 1 Integer[] result = new Integer[N + 1]; result new Integer[N + 1] N + 1 N 1 for (int i = 0; i < N; i++) {
            A1[i] = Integer.parseInt(sc.next());
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            A1[i] = Integer.parseInt(sc.next());
        } {
            A1[i] = Integer.parseInt(sc.next());
        } A1[i] = Integer.parseInt(sc.next()) A1[i] A1 i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for (int i = 0; i < N; i++) {
            A2[i] = Integer.parseInt(sc.next());
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            A2[i] = Integer.parseInt(sc.next());
        } {
            A2[i] = Integer.parseInt(sc.next());
        } A2[i] = Integer.parseInt(sc.next()) A2[i] A2 i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc a1[0] = 0 a1[0] a1 0 0 a2[0] = 0 a2[0] a2 0 0 for (int i = 0; i < N; i++) {
            a1[i + 1] = a1[i] + A1[i];
            a2[i + 1] = a2[i] + A2[i];
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            a1[i + 1] = a1[i] + A1[i];
            a2[i + 1] = a2[i] + A2[i];
        } {
            a1[i + 1] = a1[i] + A1[i];
            a2[i + 1] = a2[i] + A2[i];
        } a1[i + 1] = a1[i] + A1[i] a1[i + 1] a1 i + 1 i 1 a1[i] + A1[i] a1[i] a1 i A1[i] A1 i a2[i + 1] = a2[i] + A2[i] a2[i + 1] a2 i + 1 i 1 a2[i] + A2[i] a2[i] a2 i A2[i] A2 i result[0] = 0 result[0] result 0 0 for (int i = 1; i <= N; i++) {
            result[i] = a1[i] + a2[N] - a2[i - 1];
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            result[i] = a1[i] + a2[N] - a2[i - 1];
        } {
            result[i] = a1[i] + a2[N] - a2[i - 1];
        } result[i] = a1[i] + a2[N] - a2[i - 1] result[i] result i a1[i] + a2[N] - a2[i - 1] a1[i] + a2[N] a1[i] a1 i a2[N] a2 N a2[i - 1] a2 i - 1 i 1 Arrays.sort(result, Collections.reverseOrder()) Arrays.sort Arrays result Collections.reverseOrder() Collections.reverseOrder Collections PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) out.println(result[0]) out.println out result[0] result 0 sc.close() sc.close sc out.flush() out.flush out 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[] A1 = new int[N];
        int[] A2 = new int[N];
        int[] a1 = new int[N + 1];
        int[] a2 = new int[N + 1];
        Integer[] result = new Integer[N + 1];

        for (int i = 0; i < N; i++) {
            A1[i] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < N; i++) {
            A2[i] = Integer.parseInt(sc.next());
        }

        a1[0] = 0;
        a2[0] = 0;
        for (int i = 0; i < N; i++) {
            a1[i + 1] = a1[i] + A1[i];
            a2[i + 1] = a2[i] + A2[i];
        }

        result[0] = 0;
        for (int i = 1; i <= N; i++) {
            result[i] = a1[i] + a2[N] - a2[i - 1];
        }

        Arrays.sort(result, Collections.reverseOrder());

        PrintWriter out = new PrintWriter(System.out);
        out.println(result[0]);

        sc.close();
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int[] A1 = new int[N];
        int[] A2 = new int[N];
        int[] a1 = new int[N + 1];
        int[] a2 = new int[N + 1];
        Integer[] result = new Integer[N + 1];

        for (int i = 0; i < N; i++) {
            A1[i] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < N; i++) {
            A2[i] = Integer.parseInt(sc.next());
        }

        a1[0] = 0;
        a2[0] = 0;
        for (int i = 0; i < N; i++) {
            a1[i + 1] = a1[i] + A1[i];
            a2[i + 1] = a2[i] + A2[i];
        }

        result[0] = 0;
        for (int i = 1; i <= N; i++) {
            result[i] = a1[i] + a2[N] - a2[i - 1];
        }

        Arrays.sort(result, Collections.reverseOrder());

        PrintWriter out = new PrintWriter(System.out);
        out.println(result[0]);

        sc.close();
        out.flush();
    }
} Main
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int[] A1 = new int[N];
        int[] A2 = new int[N];
        int[] a1 = new int[N + 1];
        int[] a2 = new int[N + 1];
        Integer[] result = new Integer[N + 1];

        for (int i = 0; i < N; i++) {
            A1[i] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < N; i++) {
            A2[i] = Integer.parseInt(sc.next());
        }

        a1[0] = 0;
        a2[0] = 0;
        for (int i = 0; i < N; i++) {
            a1[i + 1] = a1[i] + A1[i];
            a2[i + 1] = a2[i] + A2[i];
        }

        result[0] = 0;
        for (int i = 1; i <= N; i++) {
            result[i] = a1[i] + a2[N] - a2[i - 1];
        }

        Arrays.sort(result, Collections.reverseOrder());

        PrintWriter out = new PrintWriter(System.out);
        out.println(result[0]);

        sc.close();
        out.flush();
    }
}