#include <bits/stdc++.h>
using namespace std;
const int MAX = 100100;
long long dp[3][MAX], gc[MAX];
int n, g[3][MAX];
int to[] = {2, 1, 0};
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 3; ++i) {
    fill(dp[i], dp[i] + MAX, -(1LL << 60));
    for (int j = 0; j < n; ++j) {
      scanf("%d", g[i] + j);
      gc[j] += g[i][j];
    }
  }
  dp[2][n] = 0;
  for (int c = n - 1; ~c; --c)
    for (int r = 0; r < 3; ++r) {
      dp[r][c] = dp[r][c + 1] + g[r][c];
      if (r == 1)
        dp[r][c] = max(dp[r][c], g[r][c] + max(dp[0][c + 1] + g[0][c],
                                               dp[2][c + 1] + g[2][c]));
      else
        dp[r][c] =
            max(max(dp[r][c], dp[1][c + 1] + g[r][c] + g[1][c]),
                gc[c] + max(dp[to[r]][c + 1], dp[to[r]][c + 2] + gc[c + 1]));
    }
  printf("%I64d\n", dp[0][0]);
  return 0;
}
