import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	private static int n;

	public static void main(String[] args) {

		Main main = new Main();
		Set<Integer> set = new HashSet<>(5);
		int[][] arr = main.scan();
		int candies = 0;
		int f = 0;
		for (int i = 0; i < n; i++) {
			f += arr[0][i];
			for (int j = i; j < n; j++) {
				candies += arr[1][j];
			}
			set.add(f + candies);
			candies = 0;
		}
		System.out.println(Collections.max(set));
	}

	private int[][] scan() {

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		int[][] arr = new int[2][n];
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < n; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	}
} import java.util.Collections; Collections java.util import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

	private static int n;

	public static void main(String[] args) {

		Main main = new Main();
		Set<Integer> set = new HashSet<>(5);
		int[][] arr = main.scan();
		int candies = 0;
		int f = 0;
		for (int i = 0; i < n; i++) {
			f += arr[0][i];
			for (int j = i; j < n; j++) {
				candies += arr[1][j];
			}
			set.add(f + candies);
			candies = 0;
		}
		System.out.println(Collections.max(set));
	}

	private int[][] scan() {

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		int[][] arr = new int[2][n];
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < n; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	}
} Main private static int n; n public static void main(String[] args) {

		Main main = new Main();
		Set<Integer> set = new HashSet<>(5);
		int[][] arr = main.scan();
		int candies = 0;
		int f = 0;
		for (int i = 0; i < n; i++) {
			f += arr[0][i];
			for (int j = i; j < n; j++) {
				candies += arr[1][j];
			}
			set.add(f + candies);
			candies = 0;
		}
		System.out.println(Collections.max(set));
	} main {

		Main main = new Main();
		Set<Integer> set = new HashSet<>(5);
		int[][] arr = main.scan();
		int candies = 0;
		int f = 0;
		for (int i = 0; i < n; i++) {
			f += arr[0][i];
			for (int j = i; j < n; j++) {
				candies += arr[1][j];
			}
			set.add(f + candies);
			candies = 0;
		}
		System.out.println(Collections.max(set));
	} Main main = new Main(); main new Main() Set<Integer> set = new HashSet<>(5); set new HashSet<>(5) int[][] arr = main.scan(); arr main.scan() main.scan main int candies = 0; candies 0 int f = 0; f 0 for (int i = 0; i < n; i++) {
			f += arr[0][i];
			for (int j = i; j < n; j++) {
				candies += arr[1][j];
			}
			set.add(f + candies);
			candies = 0;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			f += arr[0][i];
			for (int j = i; j < n; j++) {
				candies += arr[1][j];
			}
			set.add(f + candies);
			candies = 0;
		} {
			f += arr[0][i];
			for (int j = i; j < n; j++) {
				candies += arr[1][j];
			}
			set.add(f + candies);
			candies = 0;
		} f += arr[0][i] f arr[0][i] arr[0] arr 0 i for (int j = i; j < n; j++) {
				candies += arr[1][j];
			} int j = i; int j = i; j i j < n j n j++ j++ j {
				candies += arr[1][j];
			} {
				candies += arr[1][j];
			} candies += arr[1][j] candies arr[1][j] arr[1] arr 1 j set.add(f + candies) set.add set f + candies f candies candies = 0 candies 0 System.out.println(Collections.max(set)) System.out.println System.out System System.out Collections.max(set) Collections.max Collections set String[] args args private int[][] scan() {

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		int[][] arr = new int[2][n];
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < n; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	} scan {

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		int[][] arr = new int[2][n];
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < n; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc int[][] arr = new int[2][n]; arr new int[2][n] 2 n for (int i = 0; i < 2; i++) {
			for (int j = 0; j < n; j++) {
				arr[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++) {
				arr[i][j] = sc.nextInt();
			}
		} {
			for (int j = 0; j < n; j++) {
				arr[i][j] = sc.nextInt();
			}
		} for (int j = 0; j < n; j++) {
				arr[i][j] = sc.nextInt();
			} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
				arr[i][j] = sc.nextInt();
			} {
				arr[i][j] = sc.nextInt();
			} arr[i][j] = sc.nextInt() arr[i][j] arr[i] arr i j sc.nextInt() sc.nextInt sc sc.close() sc.close sc return arr; arr public class Main {

	private static int n;

	public static void main(String[] args) {

		Main main = new Main();
		Set<Integer> set = new HashSet<>(5);
		int[][] arr = main.scan();
		int candies = 0;
		int f = 0;
		for (int i = 0; i < n; i++) {
			f += arr[0][i];
			for (int j = i; j < n; j++) {
				candies += arr[1][j];
			}
			set.add(f + candies);
			candies = 0;
		}
		System.out.println(Collections.max(set));
	}

	private int[][] scan() {

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		int[][] arr = new int[2][n];
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < n; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	}
} public class Main {

	private static int n;

	public static void main(String[] args) {

		Main main = new Main();
		Set<Integer> set = new HashSet<>(5);
		int[][] arr = main.scan();
		int candies = 0;
		int f = 0;
		for (int i = 0; i < n; i++) {
			f += arr[0][i];
			for (int j = i; j < n; j++) {
				candies += arr[1][j];
			}
			set.add(f + candies);
			candies = 0;
		}
		System.out.println(Collections.max(set));
	}

	private int[][] scan() {

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		int[][] arr = new int[2][n];
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < n; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	}
} Main
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	private static int n;

	public static void main(String[] args) {

		Main main = new Main();
		Set<Integer> set = new HashSet<>(5);
		int[][] arr = main.scan();
		int candies = 0;
		int f = 0;
		for (int i = 0; i < n; i++) {
			f += arr[0][i];
			for (int j = i; j < n; j++) {
				candies += arr[1][j];
			}
			set.add(f + candies);
			candies = 0;
		}
		System.out.println(Collections.max(set));
	}

	private int[][] scan() {

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		int[][] arr = new int[2][n];
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < n; j++) {
				arr[i][j] = sc.nextInt();
			}
		}
		sc.close();
		return arr;
	}
}