import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a1 = new int[n];
        int[] a2 = new int[n];
        
        for (int i = 0; i < n; i++) {
            a1[i] = sc.nextInt();
        }
        
        int sum = a1[0];
        for (int i = 0; i < n; i++) {
            a2[i] = sc.nextInt();
            sum += a2[i];
        }
        
        int max = sum;
        
        for (int i = 1; i < n; i++) {
            sum = sum + a1[i] - a2[i - 1];
            max = Math.max(max, sum);
        }
        System.out.println(max);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a1 = new int[n];
        int[] a2 = new int[n];
        
        for (int i = 0; i < n; i++) {
            a1[i] = sc.nextInt();
        }
        
        int sum = a1[0];
        for (int i = 0; i < n; i++) {
            a2[i] = sc.nextInt();
            sum += a2[i];
        }
        
        int max = sum;
        
        for (int i = 1; i < n; i++) {
            sum = sum + a1[i] - a2[i - 1];
            max = Math.max(max, sum);
        }
        System.out.println(max);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a1 = new int[n];
        int[] a2 = new int[n];
        
        for (int i = 0; i < n; i++) {
            a1[i] = sc.nextInt();
        }
        
        int sum = a1[0];
        for (int i = 0; i < n; i++) {
            a2[i] = sc.nextInt();
            sum += a2[i];
        }
        
        int max = sum;
        
        for (int i = 1; i < n; i++) {
            sum = sum + a1[i] - a2[i - 1];
            max = Math.max(max, sum);
        }
        System.out.println(max);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a1 = new int[n];
        int[] a2 = new int[n];
        
        for (int i = 0; i < n; i++) {
            a1[i] = sc.nextInt();
        }
        
        int sum = a1[0];
        for (int i = 0; i < n; i++) {
            a2[i] = sc.nextInt();
            sum += a2[i];
        }
        
        int max = sum;
        
        for (int i = 1; i < n; i++) {
            sum = sum + a1[i] - a2[i - 1];
            max = Math.max(max, sum);
        }
        System.out.println(max);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] a1 = new int[n]; a1 new int[n] n int[] a2 = new int[n]; a2 new int[n] n for (int i = 0; i < n; i++) {
            a1[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a1[i] = sc.nextInt();
        } {
            a1[i] = sc.nextInt();
        } a1[i] = sc.nextInt() a1[i] a1 i sc.nextInt() sc.nextInt sc int sum = a1[0]; sum a1[0] a1 0 for (int i = 0; i < n; i++) {
            a2[i] = sc.nextInt();
            sum += a2[i];
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a2[i] = sc.nextInt();
            sum += a2[i];
        } {
            a2[i] = sc.nextInt();
            sum += a2[i];
        } a2[i] = sc.nextInt() a2[i] a2 i sc.nextInt() sc.nextInt sc sum += a2[i] sum a2[i] a2 i int max = sum; max sum for (int i = 1; i < n; i++) {
            sum = sum + a1[i] - a2[i - 1];
            max = Math.max(max, sum);
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            sum = sum + a1[i] - a2[i - 1];
            max = Math.max(max, sum);
        } {
            sum = sum + a1[i] - a2[i - 1];
            max = Math.max(max, sum);
        } sum = sum + a1[i] - a2[i - 1] sum sum + a1[i] - a2[i - 1] sum + a1[i] sum a1[i] a1 i a2[i - 1] a2 i - 1 i 1 max = Math.max(max, sum) max Math.max(max, sum) Math.max Math max sum 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) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a1 = new int[n];
        int[] a2 = new int[n];
        
        for (int i = 0; i < n; i++) {
            a1[i] = sc.nextInt();
        }
        
        int sum = a1[0];
        for (int i = 0; i < n; i++) {
            a2[i] = sc.nextInt();
            sum += a2[i];
        }
        
        int max = sum;
        
        for (int i = 1; i < n; i++) {
            sum = sum + a1[i] - a2[i - 1];
            max = Math.max(max, sum);
        }
        System.out.println(max);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a1 = new int[n];
        int[] a2 = new int[n];
        
        for (int i = 0; i < n; i++) {
            a1[i] = sc.nextInt();
        }
        
        int sum = a1[0];
        for (int i = 0; i < n; i++) {
            a2[i] = sc.nextInt();
            sum += a2[i];
        }
        
        int max = sum;
        
        for (int i = 1; i < n; i++) {
            sum = sum + a1[i] - a2[i - 1];
            max = Math.max(max, sum);
        }
        System.out.println(max);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a1 = new int[n];
        int[] a2 = new int[n];
        
        for (int i = 0; i < n; i++) {
            a1[i] = sc.nextInt();
        }
        
        int sum = a1[0];
        for (int i = 0; i < n; i++) {
            a2[i] = sc.nextInt();
            sum += a2[i];
        }
        
        int max = sum;
        
        for (int i = 1; i < n; i++) {
            sum = sum + a1[i] - a2[i - 1];
            max = Math.max(max, sum);
        }
        System.out.println(max);
    }
}