#include <bits/stdc++.h>
using namespace std;
void read(long long a = 0) {
  freopen("in", "r", stdin);
  if (a) freopen("out", "w", stdout);
}
long long a[4][100009] = {};
long long dp[4][100009][8][8];
long long n;
long long ans(long long r, long long ind, long long back, long long now) {
  if (ind == n) {
    if (r == 2)
      return 0;
    else
      return -1e15;
  }
  if (dp[r][ind][back][now] == -1) {
    long long tmp = -1e15;
    if (r == 0) {
      tmp = max(tmp, a[r][ind + 1] + ans(r, ind + 1, now, 4));
      if ((now & 2) == 0) {
        tmp = max(tmp, a[r + 1][ind] + ans(r + 1, ind, back, now | 2));
        if ((back & 6) == 0)
          tmp = max(tmp, a[r + 1][ind] + a[r][ind - 1] + a[r + 1][ind - 1] +
                             ans(r + 1, ind, back | 6, now | 2));
      }
    } else if (r == 1) {
      tmp = max(tmp, a[r][ind + 1] + ans(r, ind + 1, now, 2));
      if ((now & 1) == 0) {
        tmp = max(tmp, a[r + 1][ind] + ans(r + 1, ind, back, now | 1));
        if ((back & 3) == 0)
          tmp = max(tmp, a[r + 1][ind] + a[r + 1][ind - 1] + a[r][ind - 1] +
                             ans(r + 1, ind, back | 3, now | 1));
      }
      if ((now & 4) == 0) {
        tmp = max(tmp, a[r - 1][ind] + ans(r - 1, ind, back, now | 4));
        if ((back & 6) == 0)
          tmp = max(tmp, a[r - 1][ind] + a[r - 1][ind - 1] + a[r][ind - 1] +
                             ans(r - 1, ind, back | 6, now | 4));
      }
    } else {
      tmp = max(tmp, a[r][ind + 1] + ans(r, ind + 1, now, 1));
      if ((now & 2) == 0) {
        tmp = max(tmp, a[r - 1][ind] + ans(r - 1, ind, back, now | 2));
        if ((back & 3) == 0)
          tmp = max(tmp, a[r - 1][ind] + a[r][ind - 1] + a[r - 1][ind - 1] +
                             ans(r - 1, ind, back | 3, now | 2));
      }
    }
    dp[r][ind][back][now] = tmp;
  }
  return dp[r][ind][back][now];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < n; j++) cin >> a[i][j];
  }
  memset(dp, -1, sizeof(dp));
  cout << a[0][0] + ans(0, 0, 7, 4);
}
