import java.util.Scanner;

public class Main {

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

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

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

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

public class Main {

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