import java.util.Scanner;
import java.lang.Math;

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

		int[][] ans = new int[2][n];
		ans[0][0] = grid[0][0];
		ans[1][0] = grid[1][0] + ans[0][0];

		for(int j = 1; j < n; j++) {
			ans[0][j] = grid[0][j] + ans[0][j - 1];
		}
		for(int j = 1; j < n; j++) {
			ans[1][j] = grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]);
		}

		System.out.println(ans[1][n-1]);
	}

	public static void main(String[] args) {
		new Main().run();
	}
} import java.util.Scanner; Scanner java.util import java.lang.Math; Math java.lang public class Main {
	public void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[][] grid = new int[2][n];
		for(int i = 0; i < 2; i++) {
			for(int j = 0; j < n; j++) {
				grid[i][j] = sc.nextInt();
			}
		}

		int[][] ans = new int[2][n];
		ans[0][0] = grid[0][0];
		ans[1][0] = grid[1][0] + ans[0][0];

		for(int j = 1; j < n; j++) {
			ans[0][j] = grid[0][j] + ans[0][j - 1];
		}
		for(int j = 1; j < n; j++) {
			ans[1][j] = grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]);
		}

		System.out.println(ans[1][n-1]);
	}

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

		int[][] ans = new int[2][n];
		ans[0][0] = grid[0][0];
		ans[1][0] = grid[1][0] + ans[0][0];

		for(int j = 1; j < n; j++) {
			ans[0][j] = grid[0][j] + ans[0][j - 1];
		}
		for(int j = 1; j < n; j++) {
			ans[1][j] = grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]);
		}

		System.out.println(ans[1][n-1]);
	} run {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[][] grid = new int[2][n];
		for(int i = 0; i < 2; i++) {
			for(int j = 0; j < n; j++) {
				grid[i][j] = sc.nextInt();
			}
		}

		int[][] ans = new int[2][n];
		ans[0][0] = grid[0][0];
		ans[1][0] = grid[1][0] + ans[0][0];

		for(int j = 1; j < n; j++) {
			ans[0][j] = grid[0][j] + ans[0][j - 1];
		}
		for(int j = 1; j < n; j++) {
			ans[1][j] = grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]);
		}

		System.out.println(ans[1][n-1]);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[][] grid = new int[2][n]; grid new int[2][n] 2 n for(int i = 0; i < 2; i++) {
			for(int j = 0; j < n; j++) {
				grid[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++) {
				grid[i][j] = sc.nextInt();
			}
		} {
			for(int j = 0; j < n; j++) {
				grid[i][j] = sc.nextInt();
			}
		} for(int j = 0; j < n; j++) {
				grid[i][j] = sc.nextInt();
			} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
				grid[i][j] = sc.nextInt();
			} {
				grid[i][j] = sc.nextInt();
			} grid[i][j] = sc.nextInt() grid[i][j] grid[i] grid i j sc.nextInt() sc.nextInt sc int[][] ans = new int[2][n]; ans new int[2][n] 2 n ans[0][0] = grid[0][0] ans[0][0] ans[0] ans 0 0 grid[0][0] grid[0] grid 0 0 ans[1][0] = grid[1][0] + ans[0][0] ans[1][0] ans[1] ans 1 0 grid[1][0] + ans[0][0] grid[1][0] grid[1] grid 1 0 ans[0][0] ans[0] ans 0 0 for(int j = 1; j < n; j++) {
			ans[0][j] = grid[0][j] + ans[0][j - 1];
		} int j = 1; int j = 1; j 1 j < n j n j++ j++ j {
			ans[0][j] = grid[0][j] + ans[0][j - 1];
		} {
			ans[0][j] = grid[0][j] + ans[0][j - 1];
		} ans[0][j] = grid[0][j] + ans[0][j - 1] ans[0][j] ans[0] ans 0 j grid[0][j] + ans[0][j - 1] grid[0][j] grid[0] grid 0 j ans[0][j - 1] ans[0] ans 0 j - 1 j 1 for(int j = 1; j < n; j++) {
			ans[1][j] = grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]);
		} int j = 1; int j = 1; j 1 j < n j n j++ j++ j {
			ans[1][j] = grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]);
		} {
			ans[1][j] = grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]);
		} ans[1][j] = grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]) ans[1][j] ans[1] ans 1 j grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]) grid[1][j] grid[1] grid 1 j Math.max(ans[1][j - 1], ans[0][j]) Math.max Math ans[1][j - 1] ans[1] ans 1 j - 1 j 1 ans[0][j] ans[0] ans 0 j System.out.println(ans[1][n-1]) System.out.println System.out System System.out ans[1][n-1] ans[1] ans 1 n-1 n 1 public static void main(String[] args) {
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args public class Main {
	public void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[][] grid = new int[2][n];
		for(int i = 0; i < 2; i++) {
			for(int j = 0; j < n; j++) {
				grid[i][j] = sc.nextInt();
			}
		}

		int[][] ans = new int[2][n];
		ans[0][0] = grid[0][0];
		ans[1][0] = grid[1][0] + ans[0][0];

		for(int j = 1; j < n; j++) {
			ans[0][j] = grid[0][j] + ans[0][j - 1];
		}
		for(int j = 1; j < n; j++) {
			ans[1][j] = grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]);
		}

		System.out.println(ans[1][n-1]);
	}

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

		int[][] ans = new int[2][n];
		ans[0][0] = grid[0][0];
		ans[1][0] = grid[1][0] + ans[0][0];

		for(int j = 1; j < n; j++) {
			ans[0][j] = grid[0][j] + ans[0][j - 1];
		}
		for(int j = 1; j < n; j++) {
			ans[1][j] = grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]);
		}

		System.out.println(ans[1][n-1]);
	}

	public static void main(String[] args) {
		new Main().run();
	}
} Main
import java.util.Scanner;
import java.lang.Math;

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

		int[][] ans = new int[2][n];
		ans[0][0] = grid[0][0];
		ans[1][0] = grid[1][0] + ans[0][0];

		for(int j = 1; j < n; j++) {
			ans[0][j] = grid[0][j] + ans[0][j - 1];
		}
		for(int j = 1; j < n; j++) {
			ans[1][j] = grid[1][j] + Math.max(ans[1][j - 1], ans[0][j]);
		}

		System.out.println(ans[1][n-1]);
	}

	public static void main(String[] args) {
		new Main().run();
	}
}