import java.util.*;

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

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