import java.util.Scanner;

public class Main {

	static int n;
	static int[][] a;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		a = new int[2][n];
		for(int i = 0 ; i < 2 ; i++) {
			for(int j = 0 ; j < n ; j++) {
				a[i][j] = sc.nextInt();
			}
		}
		int[][] dp = new int[2][n];
		dp[0][0] = a[0][0];
		dp[1][0] = a[0][0] + a[1][0];
		if(n == 2) dp[0][1] = a[0][0] + a[0][1];
		for(int i = 0 ; i < 2 ; i++) {
			for(int j = 1 ; j < n ; j++) {
				if(i == 0) {
					dp[i][j] = Math.max(dp[i][j - 1] + a[i][j], dp[i + 1][j] + a[i][j]);
				} else if(i == 1) {
					dp[i][j] = Math.max(dp[i - 1][j] + a[i][j], dp[i][j - 1] + a[i][j]);
				}
			}
		}
		System.out.println(dp[1][n - 1]);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	static int n;
	static int[][] a;

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

	static int n;
	static int[][] a;

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

	static int n;
	static int[][] a;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		a = new int[2][n];
		for(int i = 0 ; i < 2 ; i++) {
			for(int j = 0 ; j < n ; j++) {
				a[i][j] = sc.nextInt();
			}
		}
		int[][] dp = new int[2][n];
		dp[0][0] = a[0][0];
		dp[1][0] = a[0][0] + a[1][0];
		if(n == 2) dp[0][1] = a[0][0] + a[0][1];
		for(int i = 0 ; i < 2 ; i++) {
			for(int j = 1 ; j < n ; j++) {
				if(i == 0) {
					dp[i][j] = Math.max(dp[i][j - 1] + a[i][j], dp[i + 1][j] + a[i][j]);
				} else if(i == 1) {
					dp[i][j] = Math.max(dp[i - 1][j] + a[i][j], dp[i][j - 1] + a[i][j]);
				}
			}
		}
		System.out.println(dp[1][n - 1]);
	}
} Main
import java.util.Scanner;

public class Main {

	static int n;
	static int[][] a;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		a = new int[2][n];
		for(int i = 0 ; i < 2 ; i++) {
			for(int j = 0 ; j < n ; j++) {
				a[i][j] = sc.nextInt();
			}
		}
		int[][] dp = new int[2][n];
		dp[0][0] = a[0][0];
		dp[1][0] = a[0][0] + a[1][0];
		if(n == 2) dp[0][1] = a[0][0] + a[0][1];
		for(int i = 0 ; i < 2 ; i++) {
			for(int j = 1 ; j < n ; j++) {
				if(i == 0) {
					dp[i][j] = Math.max(dp[i][j - 1] + a[i][j], dp[i + 1][j] + a[i][j]);
				} else if(i == 1) {
					dp[i][j] = Math.max(dp[i - 1][j] + a[i][j], dp[i][j - 1] + a[i][j]);
				}
			}
		}
		System.out.println(dp[1][n - 1]);
	}
}
