import java.util.Scanner;
import java.util.Arrays;

public class Main {

public static void main(String [] args){

        int N;
        int count =0;
        int Max =0;
        Scanner input = new Scanner(System.in);

        N = input.nextInt();
        int [][] arr = new int[2][N+1];
        arr[0][0] =0;
        arr[1][0] =0;

        for (int i=1; i<=N; i++ ) {
                arr[0][i] = input.nextInt();
        }
        for (int i=1; i<=N; i++ ) {
                arr[1][i] = input.nextInt();
                count += arr[1][i];
        }

        for (int i=1; i<=N; i++ ) {
                count = count + arr[0][i] - arr[1][i-1];
                if (count > Max) {
                        Max = count;
                }
        }
        System.out.println(Max);
}
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {

public static void main(String [] args){

        int N;
        int count =0;
        int Max =0;
        Scanner input = new Scanner(System.in);

        N = input.nextInt();
        int [][] arr = new int[2][N+1];
        arr[0][0] =0;
        arr[1][0] =0;

        for (int i=1; i<=N; i++ ) {
                arr[0][i] = input.nextInt();
        }
        for (int i=1; i<=N; i++ ) {
                arr[1][i] = input.nextInt();
                count += arr[1][i];
        }

        for (int i=1; i<=N; i++ ) {
                count = count + arr[0][i] - arr[1][i-1];
                if (count > Max) {
                        Max = count;
                }
        }
        System.out.println(Max);
}
} Main public static void main(String [] args){

        int N;
        int count =0;
        int Max =0;
        Scanner input = new Scanner(System.in);

        N = input.nextInt();
        int [][] arr = new int[2][N+1];
        arr[0][0] =0;
        arr[1][0] =0;

        for (int i=1; i<=N; i++ ) {
                arr[0][i] = input.nextInt();
        }
        for (int i=1; i<=N; i++ ) {
                arr[1][i] = input.nextInt();
                count += arr[1][i];
        }

        for (int i=1; i<=N; i++ ) {
                count = count + arr[0][i] - arr[1][i-1];
                if (count > Max) {
                        Max = count;
                }
        }
        System.out.println(Max);
} main {

        int N;
        int count =0;
        int Max =0;
        Scanner input = new Scanner(System.in);

        N = input.nextInt();
        int [][] arr = new int[2][N+1];
        arr[0][0] =0;
        arr[1][0] =0;

        for (int i=1; i<=N; i++ ) {
                arr[0][i] = input.nextInt();
        }
        for (int i=1; i<=N; i++ ) {
                arr[1][i] = input.nextInt();
                count += arr[1][i];
        }

        for (int i=1; i<=N; i++ ) {
                count = count + arr[0][i] - arr[1][i-1];
                if (count > Max) {
                        Max = count;
                }
        }
        System.out.println(Max);
} int N; N int count =0; count 0 int Max =0; Max 0 Scanner input = new Scanner(System.in); input new Scanner(System.in) N = input.nextInt() N input.nextInt() input.nextInt input int [][] arr = new int[2][N+1]; arr new int[2][N+1] 2 N+1 N 1 arr[0][0] =0 arr[0][0] arr[0] arr 0 0 0 arr[1][0] =0 arr[1][0] arr[1] arr 1 0 0 for (int i=1; i<=N; i++ ) {
                arr[0][i] = input.nextInt();
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
                arr[0][i] = input.nextInt();
        } {
                arr[0][i] = input.nextInt();
        } arr[0][i] = input.nextInt() arr[0][i] arr[0] arr 0 i input.nextInt() input.nextInt input for (int i=1; i<=N; i++ ) {
                arr[1][i] = input.nextInt();
                count += arr[1][i];
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
                arr[1][i] = input.nextInt();
                count += arr[1][i];
        } {
                arr[1][i] = input.nextInt();
                count += arr[1][i];
        } arr[1][i] = input.nextInt() arr[1][i] arr[1] arr 1 i input.nextInt() input.nextInt input count += arr[1][i] count arr[1][i] arr[1] arr 1 i for (int i=1; i<=N; i++ ) {
                count = count + arr[0][i] - arr[1][i-1];
                if (count > Max) {
                        Max = count;
                }
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
                count = count + arr[0][i] - arr[1][i-1];
                if (count > Max) {
                        Max = count;
                }
        } {
                count = count + arr[0][i] - arr[1][i-1];
                if (count > Max) {
                        Max = count;
                }
        } count = count + arr[0][i] - arr[1][i-1] count count + arr[0][i] - arr[1][i-1] count + arr[0][i] count arr[0][i] arr[0] arr 0 i arr[1][i-1] arr[1] arr 1 i-1 i 1 if (count > Max) {
                        Max = count;
                } count > Max count Max {
                        Max = count;
                } Max = count Max count System.out.println(Max) System.out.println System.out System System.out Max String [] args args public class Main {

public static void main(String [] args){

        int N;
        int count =0;
        int Max =0;
        Scanner input = new Scanner(System.in);

        N = input.nextInt();
        int [][] arr = new int[2][N+1];
        arr[0][0] =0;
        arr[1][0] =0;

        for (int i=1; i<=N; i++ ) {
                arr[0][i] = input.nextInt();
        }
        for (int i=1; i<=N; i++ ) {
                arr[1][i] = input.nextInt();
                count += arr[1][i];
        }

        for (int i=1; i<=N; i++ ) {
                count = count + arr[0][i] - arr[1][i-1];
                if (count > Max) {
                        Max = count;
                }
        }
        System.out.println(Max);
}
} public class Main {

public static void main(String [] args){

        int N;
        int count =0;
        int Max =0;
        Scanner input = new Scanner(System.in);

        N = input.nextInt();
        int [][] arr = new int[2][N+1];
        arr[0][0] =0;
        arr[1][0] =0;

        for (int i=1; i<=N; i++ ) {
                arr[0][i] = input.nextInt();
        }
        for (int i=1; i<=N; i++ ) {
                arr[1][i] = input.nextInt();
                count += arr[1][i];
        }

        for (int i=1; i<=N; i++ ) {
                count = count + arr[0][i] - arr[1][i-1];
                if (count > Max) {
                        Max = count;
                }
        }
        System.out.println(Max);
}
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main {

public static void main(String [] args){

        int N;
        int count =0;
        int Max =0;
        Scanner input = new Scanner(System.in);

        N = input.nextInt();
        int [][] arr = new int[2][N+1];
        arr[0][0] =0;
        arr[1][0] =0;

        for (int i=1; i<=N; i++ ) {
                arr[0][i] = input.nextInt();
        }
        for (int i=1; i<=N; i++ ) {
                arr[1][i] = input.nextInt();
                count += arr[1][i];
        }

        for (int i=1; i<=N; i++ ) {
                count = count + arr[0][i] - arr[1][i-1];
                if (count > Max) {
                        Max = count;
                }
        }
        System.out.println(Max);
}
}
