import java.util.*;
import java.io.*;

public class Main{
    public static void main(String[] args) {
    	InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Solve solver = new Solve();
        solver.solve(1, in, out);
        out.close();
    }
    static int n;
    static int[][] mat;
    static int dfs(int x, int y) {
    	int[] movx = new int[] {1,0};
    	int[] movy = new int[] {0,1};
    	if(y==1&x==n-1) {
    		return 0;
    	}
    	int ans = 0;
    	for(int i = 0;i<2;i++) {
    		int nwx=x+movx[i];
    		int nwy=y+movy[i];
    		if(nwx>=0&nwx<n&nwy>=0&nwy<2) {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		}
    	}
    	return ans;
    }
    static class Solve {
    	public void solve(int testNumber, InputReader in, OutputWriter out) {
    		n = in.nextInt();
    		mat = new int[2][n];
    		for(int i = 0;i<2;i++) {
    			for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			}
    		}
    		out.println(dfs(0,0)+mat[0][0]);
    	}
    }
    	
    
    static class OutputWriter {
	    private final PrintWriter writer;
	
	    public OutputWriter(OutputStream outputStream) {
	        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	    }
	
	    public OutputWriter(Writer writer) {
	        this.writer = new PrintWriter(writer);
	    }
	
	    public void close() {
	        writer.close();
	    }
	
	    public void println(String string) {
	        writer.println(string);
	    }
	    
	    public void println(int number) {
	        writer.println(number);
	    }
	    
	    public void println(long number) {
	        writer.println(number);
	    }
	    
	    public void println(double number) {
	    	writer.println(number);
	    }
	    
	    public void print(long number) {
	        writer.print(number);
	    }
	    
	    public void print(int number) {
	        writer.print(number);
	    }
	    
	    public void print(String string) {
	        writer.print(string);
	    }
	    
	    public void print(double number) {
	    	writer.print(number);
	    }
	}
    
	static class InputReader { 
		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;
		
		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}
		
		public String nextLine() {
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		
		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}
 
		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}
 
		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}
 
		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}
 
		public boolean hasNext() {
			skip();
			return hasNextByte();
		}
 
		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
 
		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
 
		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
		
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
 
		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}
 
		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
    public static void main(String[] args) {
    	InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Solve solver = new Solve();
        solver.solve(1, in, out);
        out.close();
    }
    static int n;
    static int[][] mat;
    static int dfs(int x, int y) {
    	int[] movx = new int[] {1,0};
    	int[] movy = new int[] {0,1};
    	if(y==1&x==n-1) {
    		return 0;
    	}
    	int ans = 0;
    	for(int i = 0;i<2;i++) {
    		int nwx=x+movx[i];
    		int nwy=y+movy[i];
    		if(nwx>=0&nwx<n&nwy>=0&nwy<2) {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		}
    	}
    	return ans;
    }
    static class Solve {
    	public void solve(int testNumber, InputReader in, OutputWriter out) {
    		n = in.nextInt();
    		mat = new int[2][n];
    		for(int i = 0;i<2;i++) {
    			for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			}
    		}
    		out.println(dfs(0,0)+mat[0][0]);
    	}
    }
    	
    
    static class OutputWriter {
	    private final PrintWriter writer;
	
	    public OutputWriter(OutputStream outputStream) {
	        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	    }
	
	    public OutputWriter(Writer writer) {
	        this.writer = new PrintWriter(writer);
	    }
	
	    public void close() {
	        writer.close();
	    }
	
	    public void println(String string) {
	        writer.println(string);
	    }
	    
	    public void println(int number) {
	        writer.println(number);
	    }
	    
	    public void println(long number) {
	        writer.println(number);
	    }
	    
	    public void println(double number) {
	    	writer.println(number);
	    }
	    
	    public void print(long number) {
	        writer.print(number);
	    }
	    
	    public void print(int number) {
	        writer.print(number);
	    }
	    
	    public void print(String string) {
	        writer.print(string);
	    }
	    
	    public void print(double number) {
	    	writer.print(number);
	    }
	}
    
	static class InputReader { 
		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;
		
		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}
		
		public String nextLine() {
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		
		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}
 
		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}
 
		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}
 
		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}
 
		public boolean hasNext() {
			skip();
			return hasNextByte();
		}
 
		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
 
		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
 
		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
		
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
 
		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}
 
		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
} Main static int n; n static int[][] mat; mat public static void main(String[] args) {
    	InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Solve solver = new Solve();
        solver.solve(1, in, out);
        out.close();
    } main {
    	InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Solve solver = new Solve();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out InputReader in = new InputReader(inputStream); in new InputReader(inputStream) OutputWriter out = new OutputWriter(outputStream); out new OutputWriter(outputStream) Solve solver = new Solve(); solver new Solve() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static int dfs(int x, int y) {
    	int[] movx = new int[] {1,0};
    	int[] movy = new int[] {0,1};
    	if(y==1&x==n-1) {
    		return 0;
    	}
    	int ans = 0;
    	for(int i = 0;i<2;i++) {
    		int nwx=x+movx[i];
    		int nwy=y+movy[i];
    		if(nwx>=0&nwx<n&nwy>=0&nwy<2) {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		}
    	}
    	return ans;
    } dfs {
    	int[] movx = new int[] {1,0};
    	int[] movy = new int[] {0,1};
    	if(y==1&x==n-1) {
    		return 0;
    	}
    	int ans = 0;
    	for(int i = 0;i<2;i++) {
    		int nwx=x+movx[i];
    		int nwy=y+movy[i];
    		if(nwx>=0&nwx<n&nwy>=0&nwy<2) {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		}
    	}
    	return ans;
    } int[] movx = new int[] {1,0}; movx new int[] {1,0} int[] movy = new int[] {0,1}; movy new int[] {0,1} if(y==1&x==n-1) {
    		return 0;
    	} y==1&x==n-1 y==1 y 1 x==n-1 x n-1 n 1 {
    		return 0;
    	} return 0; 0 int ans = 0; ans 0 for(int i = 0;i<2;i++) {
    		int nwx=x+movx[i];
    		int nwy=y+movy[i];
    		if(nwx>=0&nwx<n&nwy>=0&nwy<2) {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		}
    	} int i = 0; int i = 0; i 0 i<2 i 2 i++ i++ i {
    		int nwx=x+movx[i];
    		int nwy=y+movy[i];
    		if(nwx>=0&nwx<n&nwy>=0&nwy<2) {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		}
    	} {
    		int nwx=x+movx[i];
    		int nwy=y+movy[i];
    		if(nwx>=0&nwx<n&nwy>=0&nwy<2) {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		}
    	} int nwx=x+movx[i]; nwx x+movx[i] x movx[i] movx i int nwy=y+movy[i]; nwy y+movy[i] y movy[i] movy i if(nwx>=0&nwx<n&nwy>=0&nwy<2) {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		} nwx>=0&nwx<n&nwy>=0&nwy<2 nwy>=0 nwx>=0&nwx<n&nwy>=0&nwy<2 nwx>=0 nwx 0 nwx<n nwx n nwy>=0 nwy 0 nwy<2 nwy 2 {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		} ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]) ans Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]) Math.max Math ans dfs(nwx,nwy)+mat[nwy][nwx] dfs(nwx,nwy) dfs nwx nwy mat[nwy][nwx] mat[nwy] mat nwy nwx return ans; ans int x x int y y static class Solve {
    	public void solve(int testNumber, InputReader in, OutputWriter out) {
    		n = in.nextInt();
    		mat = new int[2][n];
    		for(int i = 0;i<2;i++) {
    			for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			}
    		}
    		out.println(dfs(0,0)+mat[0][0]);
    	}
    } Solve public void solve(int testNumber, InputReader in, OutputWriter out) {
    		n = in.nextInt();
    		mat = new int[2][n];
    		for(int i = 0;i<2;i++) {
    			for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			}
    		}
    		out.println(dfs(0,0)+mat[0][0]);
    	} solve {
    		n = in.nextInt();
    		mat = new int[2][n];
    		for(int i = 0;i<2;i++) {
    			for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			}
    		}
    		out.println(dfs(0,0)+mat[0][0]);
    	} n = in.nextInt() n in.nextInt() in.nextInt in mat = new int[2][n] mat new int[2][n] 2 n for(int i = 0;i<2;i++) {
    			for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			}
    		} int i = 0; int i = 0; i 0 i<2 i 2 i++ i++ i {
    			for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			}
    		} {
    			for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			}
    		} for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			} int o = 0; int o = 0; o 0 o<n o n o++ o++ o {
    				mat[i][o] = in.nextInt();
    			} {
    				mat[i][o] = in.nextInt();
    			} mat[i][o] = in.nextInt() mat[i][o] mat[i] mat i o in.nextInt() in.nextInt in out.println(dfs(0,0)+mat[0][0]) out.println out dfs(0,0)+mat[0][0] dfs(0,0) dfs 0 0 mat[0][0] mat[0] mat 0 0 int testNumber testNumber InputReader in in OutputWriter out out static class OutputWriter {
	    private final PrintWriter writer;
	
	    public OutputWriter(OutputStream outputStream) {
	        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	    }
	
	    public OutputWriter(Writer writer) {
	        this.writer = new PrintWriter(writer);
	    }
	
	    public void close() {
	        writer.close();
	    }
	
	    public void println(String string) {
	        writer.println(string);
	    }
	    
	    public void println(int number) {
	        writer.println(number);
	    }
	    
	    public void println(long number) {
	        writer.println(number);
	    }
	    
	    public void println(double number) {
	    	writer.println(number);
	    }
	    
	    public void print(long number) {
	        writer.print(number);
	    }
	    
	    public void print(int number) {
	        writer.print(number);
	    }
	    
	    public void print(String string) {
	        writer.print(string);
	    }
	    
	    public void print(double number) {
	    	writer.print(number);
	    }
	} OutputWriter private final PrintWriter writer; writer public OutputWriter(OutputStream outputStream) {
	        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	    } OutputWriter {
	        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	    } writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream))) writer new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream))) OutputStream outputStream outputStream public OutputWriter(Writer writer) {
	        this.writer = new PrintWriter(writer);
	    } OutputWriter {
	        this.writer = new PrintWriter(writer);
	    } this.writer = new PrintWriter(writer) this.writer this this.writer new PrintWriter(writer) Writer writer writer public void close() {
	        writer.close();
	    } close {
	        writer.close();
	    } writer.close() writer.close writer public void println(String string) {
	        writer.println(string);
	    } println {
	        writer.println(string);
	    } writer.println(string) writer.println writer string String string string public void println(int number) {
	        writer.println(number);
	    } println {
	        writer.println(number);
	    } writer.println(number) writer.println writer number int number number public void println(long number) {
	        writer.println(number);
	    } println {
	        writer.println(number);
	    } writer.println(number) writer.println writer number long number number public void println(double number) {
	    	writer.println(number);
	    } println {
	    	writer.println(number);
	    } writer.println(number) writer.println writer number double number number public void print(long number) {
	        writer.print(number);
	    } print {
	        writer.print(number);
	    } writer.print(number) writer.print writer number long number number public void print(int number) {
	        writer.print(number);
	    } print {
	        writer.print(number);
	    } writer.print(number) writer.print writer number int number number public void print(String string) {
	        writer.print(string);
	    } print {
	        writer.print(string);
	    } writer.print(string) writer.print writer string String string string public void print(double number) {
	    	writer.print(number);
	    } print {
	    	writer.print(number);
	    } writer.print(number) writer.print writer number double number number static class InputReader { 
		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;
		
		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}
		
		public String nextLine() {
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		
		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}
 
		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}
 
		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}
 
		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}
 
		public boolean hasNext() {
			skip();
			return hasNextByte();
		}
 
		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
 
		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
 
		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
		
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
 
		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}
 
		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	} InputReader private InputStream in; in private byte[] buffer = new byte[1024]; buffer new byte[1024] 1024 private int curbuf; curbuf private int lenbuf; lenbuf public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		} InputReader {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		} this.in = in this.in this this.in in this.curbuf = this.lenbuf = 0 this.curbuf this this.curbuf this.lenbuf = 0 this.lenbuf this this.lenbuf 0 InputStream in in public String nextLine() {
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		} nextLine {
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		} StringBuilder sb = new StringBuilder(); sb new StringBuilder() int b = readByte(); b readByte() readByte while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			} b!=10 b 10 {
				sb.appendCodePoint(b);
				b = readByte();
			} sb.appendCodePoint(b) sb.appendCodePoint sb b b = readByte() b readByte() readByte return sb.toString(); sb.toString() sb.toString sb public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		} hasNextByte {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		} if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			} curbuf >= lenbuf curbuf lenbuf {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			} curbuf = 0 curbuf 0 try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				} catch (IOException e) {
					throw new InputMismatchException();
				} IOException e {
					throw new InputMismatchException();
				} throw new InputMismatchException(); new InputMismatchException() {
					lenbuf = in.read(buffer);
				} lenbuf = in.read(buffer) lenbuf in.read(buffer) in.read in buffer if (lenbuf <= 0)
					return false; lenbuf <= 0 lenbuf 0 return false; false return true; true private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		} readByte {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		} if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1; hasNextByte() hasNextByte return buffer[curbuf++]; buffer[curbuf++] buffer curbuf++ curbuf return -1; -1 1 private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		} isSpaceChar {
			return !(c >= 33 && c <= 126);
		} return !(c >= 33 && c <= 126); !(c >= 33 && c <= 126) (c >= 33 && c <= 126) c >= 33 c 33 c <= 126 c 126 int c c private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		} skip {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		} while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++; hasNextByte() && isSpaceChar(buffer[curbuf]) hasNextByte() hasNextByte isSpaceChar(buffer[curbuf]) isSpaceChar buffer[curbuf] buffer curbuf curbuf++ curbuf public boolean hasNext() {
			skip();
			return hasNextByte();
		} hasNext {
			skip();
			return hasNextByte();
		} skip() skip return hasNextByte(); hasNextByte() hasNextByte public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		} next {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		} if (!hasNext())
				throw new NoSuchElementException(); !hasNext() hasNext() hasNext throw new NoSuchElementException(); new NoSuchElementException() StringBuilder sb = new StringBuilder(); sb new StringBuilder() int b = readByte(); b readByte() readByte while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			} !isSpaceChar(b) isSpaceChar(b) isSpaceChar b {
				sb.appendCodePoint(b);
				b = readByte();
			} sb.appendCodePoint(b) sb.appendCodePoint sb b b = readByte() b readByte() readByte return sb.toString(); sb.toString() sb.toString sb public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		} nextInt {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		} if (!hasNext())
				throw new NoSuchElementException(); !hasNext() hasNext() hasNext throw new NoSuchElementException(); new NoSuchElementException() int c = readByte(); c readByte() readByte while (isSpaceChar(c))
				c = readByte(); isSpaceChar(c) isSpaceChar c c = readByte() c readByte() readByte boolean minus = false; minus false if (c == '-') {
				minus = true;
				c = readByte();
			} c == '-' c '-' {
				minus = true;
				c = readByte();
			} minus = true minus true c = readByte() c readByte() readByte int res = 0; res 0 do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} if (c < '0' || c > '9')
					throw new InputMismatchException(); c < '0' || c > '9' c < '0' c '0' c > '9' c '9' throw new InputMismatchException(); new InputMismatchException() res = res * 10 + c - '0' res res * 10 + c - '0' res * 10 + c res * 10 res 10 c '0' c = readByte() c readByte() readByte return (minus) ? -res : res; (minus) ? -res : res (minus) -res res res public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		} nextLong {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		} if (!hasNext())
				throw new NoSuchElementException(); !hasNext() hasNext() hasNext throw new NoSuchElementException(); new NoSuchElementException() int c = readByte(); c readByte() readByte while (isSpaceChar(c))
				c = readByte(); isSpaceChar(c) isSpaceChar c c = readByte() c readByte() readByte boolean minus = false; minus false if (c == '-') {
				minus = true;
				c = readByte();
			} c == '-' c '-' {
				minus = true;
				c = readByte();
			} minus = true minus true c = readByte() c readByte() readByte long res = 0; res 0 do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} if (c < '0' || c > '9')
					throw new InputMismatchException(); c < '0' || c > '9' c < '0' c '0' c > '9' c '9' throw new InputMismatchException(); new InputMismatchException() res = res * 10 + c - '0' res res * 10 + c - '0' res * 10 + c res * 10 res 10 c '0' c = readByte() c readByte() readByte return (minus) ? -res : res; (minus) ? -res : res (minus) -res res res public double nextDouble() {
			return Double.parseDouble(next());
		} nextDouble {
			return Double.parseDouble(next());
		} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		} nextIntArray {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		} int[] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++)
				a[i] = nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextInt(); a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		} nextLongArray {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		} long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++)
				a[i] = nextLong(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextLong(); a[i] = nextLong() a[i] a i nextLong() nextLong return a; a int n n public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		} nextCharMap {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		} char[][] map = new char[n][m]; map new char[n][m] n m for (int i = 0; i < n; i++)
				map[i] = next().toCharArray(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i map[i] = next().toCharArray(); map[i] = next().toCharArray() map[i] map i next().toCharArray() next().toCharArray next() next return map; map int n n int m m public class Main{
    public static void main(String[] args) {
    	InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Solve solver = new Solve();
        solver.solve(1, in, out);
        out.close();
    }
    static int n;
    static int[][] mat;
    static int dfs(int x, int y) {
    	int[] movx = new int[] {1,0};
    	int[] movy = new int[] {0,1};
    	if(y==1&x==n-1) {
    		return 0;
    	}
    	int ans = 0;
    	for(int i = 0;i<2;i++) {
    		int nwx=x+movx[i];
    		int nwy=y+movy[i];
    		if(nwx>=0&nwx<n&nwy>=0&nwy<2) {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		}
    	}
    	return ans;
    }
    static class Solve {
    	public void solve(int testNumber, InputReader in, OutputWriter out) {
    		n = in.nextInt();
    		mat = new int[2][n];
    		for(int i = 0;i<2;i++) {
    			for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			}
    		}
    		out.println(dfs(0,0)+mat[0][0]);
    	}
    }
    	
    
    static class OutputWriter {
	    private final PrintWriter writer;
	
	    public OutputWriter(OutputStream outputStream) {
	        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	    }
	
	    public OutputWriter(Writer writer) {
	        this.writer = new PrintWriter(writer);
	    }
	
	    public void close() {
	        writer.close();
	    }
	
	    public void println(String string) {
	        writer.println(string);
	    }
	    
	    public void println(int number) {
	        writer.println(number);
	    }
	    
	    public void println(long number) {
	        writer.println(number);
	    }
	    
	    public void println(double number) {
	    	writer.println(number);
	    }
	    
	    public void print(long number) {
	        writer.print(number);
	    }
	    
	    public void print(int number) {
	        writer.print(number);
	    }
	    
	    public void print(String string) {
	        writer.print(string);
	    }
	    
	    public void print(double number) {
	    	writer.print(number);
	    }
	}
    
	static class InputReader { 
		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;
		
		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}
		
		public String nextLine() {
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		
		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}
 
		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}
 
		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}
 
		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}
 
		public boolean hasNext() {
			skip();
			return hasNextByte();
		}
 
		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
 
		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
 
		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
		
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
 
		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}
 
		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
} public class Main{
    public static void main(String[] args) {
    	InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Solve solver = new Solve();
        solver.solve(1, in, out);
        out.close();
    }
    static int n;
    static int[][] mat;
    static int dfs(int x, int y) {
    	int[] movx = new int[] {1,0};
    	int[] movy = new int[] {0,1};
    	if(y==1&x==n-1) {
    		return 0;
    	}
    	int ans = 0;
    	for(int i = 0;i<2;i++) {
    		int nwx=x+movx[i];
    		int nwy=y+movy[i];
    		if(nwx>=0&nwx<n&nwy>=0&nwy<2) {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		}
    	}
    	return ans;
    }
    static class Solve {
    	public void solve(int testNumber, InputReader in, OutputWriter out) {
    		n = in.nextInt();
    		mat = new int[2][n];
    		for(int i = 0;i<2;i++) {
    			for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			}
    		}
    		out.println(dfs(0,0)+mat[0][0]);
    	}
    }
    	
    
    static class OutputWriter {
	    private final PrintWriter writer;
	
	    public OutputWriter(OutputStream outputStream) {
	        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	    }
	
	    public OutputWriter(Writer writer) {
	        this.writer = new PrintWriter(writer);
	    }
	
	    public void close() {
	        writer.close();
	    }
	
	    public void println(String string) {
	        writer.println(string);
	    }
	    
	    public void println(int number) {
	        writer.println(number);
	    }
	    
	    public void println(long number) {
	        writer.println(number);
	    }
	    
	    public void println(double number) {
	    	writer.println(number);
	    }
	    
	    public void print(long number) {
	        writer.print(number);
	    }
	    
	    public void print(int number) {
	        writer.print(number);
	    }
	    
	    public void print(String string) {
	        writer.print(string);
	    }
	    
	    public void print(double number) {
	    	writer.print(number);
	    }
	}
    
	static class InputReader { 
		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;
		
		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}
		
		public String nextLine() {
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		
		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}
 
		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}
 
		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}
 
		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}
 
		public boolean hasNext() {
			skip();
			return hasNextByte();
		}
 
		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
 
		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
 
		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
		
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
 
		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}
 
		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
} Main
import java.util.*;
import java.io.*;

public class Main{
    public static void main(String[] args) {
    	InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Solve solver = new Solve();
        solver.solve(1, in, out);
        out.close();
    }
    static int n;
    static int[][] mat;
    static int dfs(int x, int y) {
    	int[] movx = new int[] {1,0};
    	int[] movy = new int[] {0,1};
    	if(y==1&x==n-1) {
    		return 0;
    	}
    	int ans = 0;
    	for(int i = 0;i<2;i++) {
    		int nwx=x+movx[i];
    		int nwy=y+movy[i];
    		if(nwx>=0&nwx<n&nwy>=0&nwy<2) {
    			ans = Math.max(ans, dfs(nwx,nwy)+mat[nwy][nwx]);
    		}
    	}
    	return ans;
    }
    static class Solve {
    	public void solve(int testNumber, InputReader in, OutputWriter out) {
    		n = in.nextInt();
    		mat = new int[2][n];
    		for(int i = 0;i<2;i++) {
    			for(int o = 0;o<n;o++) {
    				mat[i][o] = in.nextInt();
    			}
    		}
    		out.println(dfs(0,0)+mat[0][0]);
    	}
    }
    	
    
    static class OutputWriter {
	    private final PrintWriter writer;
	
	    public OutputWriter(OutputStream outputStream) {
	        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	    }
	
	    public OutputWriter(Writer writer) {
	        this.writer = new PrintWriter(writer);
	    }
	
	    public void close() {
	        writer.close();
	    }
	
	    public void println(String string) {
	        writer.println(string);
	    }
	    
	    public void println(int number) {
	        writer.println(number);
	    }
	    
	    public void println(long number) {
	        writer.println(number);
	    }
	    
	    public void println(double number) {
	    	writer.println(number);
	    }
	    
	    public void print(long number) {
	        writer.print(number);
	    }
	    
	    public void print(int number) {
	        writer.print(number);
	    }
	    
	    public void print(String string) {
	        writer.print(string);
	    }
	    
	    public void print(double number) {
	    	writer.print(number);
	    }
	}
    
	static class InputReader { 
		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;
		
		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}
		
		public String nextLine() {
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		
		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}
 
		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}
 
		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}
 
		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}
 
		public boolean hasNext() {
			skip();
			return hasNextByte();
		}
 
		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
 
		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
 
		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}
		
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
 
		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}
 
		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
}