import java.util.Scanner;
import java.util.stream.IntStream;

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

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