import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());

		List<Integer> A1 = new ArrayList<Integer>();
		List<Integer> A2 = new ArrayList<Integer>();

		String[] inp = br.readLine().split(" ");
		String[] inp2 = br.readLine().split(" ");

		int sum = 0,sum1 = 0;
		for (int i = 0;i<inp.length;i++){
			sum += Integer.parseInt(inp[i]);
			sum1 += Integer.parseInt(inp2[i]);
			A1.add(sum);
			A2.add(sum1);
		}

		int maxCandy = A1.get(0) + A2.get(N-1);

		for(int i = 1;i<N;i++){
			int now = A1.get(i) + (A2.get(N-1) - A2.get(i-1));
			maxCandy = Math.max(now, maxCandy);
		}

		System.out.println(maxCandy);


	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());

		List<Integer> A1 = new ArrayList<Integer>();
		List<Integer> A2 = new ArrayList<Integer>();

		String[] inp = br.readLine().split(" ");
		String[] inp2 = br.readLine().split(" ");

		int sum = 0,sum1 = 0;
		for (int i = 0;i<inp.length;i++){
			sum += Integer.parseInt(inp[i]);
			sum1 += Integer.parseInt(inp2[i]);
			A1.add(sum);
			A2.add(sum1);
		}

		int maxCandy = A1.get(0) + A2.get(N-1);

		for(int i = 1;i<N;i++){
			int now = A1.get(i) + (A2.get(N-1) - A2.get(i-1));
			maxCandy = Math.max(now, maxCandy);
		}

		System.out.println(maxCandy);


	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());

		List<Integer> A1 = new ArrayList<Integer>();
		List<Integer> A2 = new ArrayList<Integer>();

		String[] inp = br.readLine().split(" ");
		String[] inp2 = br.readLine().split(" ");

		int sum = 0,sum1 = 0;
		for (int i = 0;i<inp.length;i++){
			sum += Integer.parseInt(inp[i]);
			sum1 += Integer.parseInt(inp2[i]);
			A1.add(sum);
			A2.add(sum1);
		}

		int maxCandy = A1.get(0) + A2.get(N-1);

		for(int i = 1;i<N;i++){
			int now = A1.get(i) + (A2.get(N-1) - A2.get(i-1));
			maxCandy = Math.max(now, maxCandy);
		}

		System.out.println(maxCandy);


	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());

		List<Integer> A1 = new ArrayList<Integer>();
		List<Integer> A2 = new ArrayList<Integer>();

		String[] inp = br.readLine().split(" ");
		String[] inp2 = br.readLine().split(" ");

		int sum = 0,sum1 = 0;
		for (int i = 0;i<inp.length;i++){
			sum += Integer.parseInt(inp[i]);
			sum1 += Integer.parseInt(inp2[i]);
			A1.add(sum);
			A2.add(sum1);
		}

		int maxCandy = A1.get(0) + A2.get(N-1);

		for(int i = 1;i<N;i++){
			int now = A1.get(i) + (A2.get(N-1) - A2.get(i-1));
			maxCandy = Math.max(now, maxCandy);
		}

		System.out.println(maxCandy);


	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br List<Integer> A1 = new ArrayList<Integer>(); A1 new ArrayList<Integer>() List<Integer> A2 = new ArrayList<Integer>(); A2 new ArrayList<Integer>() String[] inp = br.readLine().split(" "); inp br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " String[] inp2 = br.readLine().split(" "); inp2 br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int sum = 0 sum 0 sum1 = 0; sum1 0 for (int i = 0;i<inp.length;i++){
			sum += Integer.parseInt(inp[i]);
			sum1 += Integer.parseInt(inp2[i]);
			A1.add(sum);
			A2.add(sum1);
		} int i = 0; int i = 0; i 0 i<inp.length i inp.length inp inp.length i++ i++ i {
			sum += Integer.parseInt(inp[i]);
			sum1 += Integer.parseInt(inp2[i]);
			A1.add(sum);
			A2.add(sum1);
		} {
			sum += Integer.parseInt(inp[i]);
			sum1 += Integer.parseInt(inp2[i]);
			A1.add(sum);
			A2.add(sum1);
		} sum += Integer.parseInt(inp[i]) sum Integer.parseInt(inp[i]) Integer.parseInt Integer inp[i] inp i sum1 += Integer.parseInt(inp2[i]) sum1 Integer.parseInt(inp2[i]) Integer.parseInt Integer inp2[i] inp2 i A1.add(sum) A1.add A1 sum A2.add(sum1) A2.add A2 sum1 int maxCandy = A1.get(0) + A2.get(N-1); maxCandy A1.get(0) + A2.get(N-1) A1.get(0) A1.get A1 0 A2.get(N-1) A2.get A2 N-1 N 1 for(int i = 1;i<N;i++){
			int now = A1.get(i) + (A2.get(N-1) - A2.get(i-1));
			maxCandy = Math.max(now, maxCandy);
		} int i = 1; int i = 1; i 1 i<N i N i++ i++ i {
			int now = A1.get(i) + (A2.get(N-1) - A2.get(i-1));
			maxCandy = Math.max(now, maxCandy);
		} {
			int now = A1.get(i) + (A2.get(N-1) - A2.get(i-1));
			maxCandy = Math.max(now, maxCandy);
		} int now = A1.get(i) + (A2.get(N-1) - A2.get(i-1)); now A1.get(i) + (A2.get(N-1) - A2.get(i-1)) A1.get(i) A1.get A1 i (A2.get(N-1) - A2.get(i-1)) A2.get(N-1) A2.get A2 N-1 N 1 A2.get(i-1) A2.get A2 i-1 i 1 maxCandy = Math.max(now, maxCandy) maxCandy Math.max(now, maxCandy) Math.max Math now maxCandy System.out.println(maxCandy) System.out.println System.out System System.out maxCandy String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());

		List<Integer> A1 = new ArrayList<Integer>();
		List<Integer> A2 = new ArrayList<Integer>();

		String[] inp = br.readLine().split(" ");
		String[] inp2 = br.readLine().split(" ");

		int sum = 0,sum1 = 0;
		for (int i = 0;i<inp.length;i++){
			sum += Integer.parseInt(inp[i]);
			sum1 += Integer.parseInt(inp2[i]);
			A1.add(sum);
			A2.add(sum1);
		}

		int maxCandy = A1.get(0) + A2.get(N-1);

		for(int i = 1;i<N;i++){
			int now = A1.get(i) + (A2.get(N-1) - A2.get(i-1));
			maxCandy = Math.max(now, maxCandy);
		}

		System.out.println(maxCandy);


	}
} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());

		List<Integer> A1 = new ArrayList<Integer>();
		List<Integer> A2 = new ArrayList<Integer>();

		String[] inp = br.readLine().split(" ");
		String[] inp2 = br.readLine().split(" ");

		int sum = 0,sum1 = 0;
		for (int i = 0;i<inp.length;i++){
			sum += Integer.parseInt(inp[i]);
			sum1 += Integer.parseInt(inp2[i]);
			A1.add(sum);
			A2.add(sum1);
		}

		int maxCandy = A1.get(0) + A2.get(N-1);

		for(int i = 1;i<N;i++){
			int now = A1.get(i) + (A2.get(N-1) - A2.get(i-1));
			maxCandy = Math.max(now, maxCandy);
		}

		System.out.println(maxCandy);


	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());

		List<Integer> A1 = new ArrayList<Integer>();
		List<Integer> A2 = new ArrayList<Integer>();

		String[] inp = br.readLine().split(" ");
		String[] inp2 = br.readLine().split(" ");

		int sum = 0,sum1 = 0;
		for (int i = 0;i<inp.length;i++){
			sum += Integer.parseInt(inp[i]);
			sum1 += Integer.parseInt(inp2[i]);
			A1.add(sum);
			A2.add(sum1);
		}

		int maxCandy = A1.get(0) + A2.get(N-1);

		for(int i = 1;i<N;i++){
			int now = A1.get(i) + (A2.get(N-1) - A2.get(i-1));
			maxCandy = Math.max(now, maxCandy);
		}

		System.out.println(maxCandy);


	}
}