import java.util.*;

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

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