#include <bits/stdc++.h>
using namespace std;
long long int a, b, c, d, e, f, g, h, x[4][100009], y[100009][5][5] = {},
                                                    z[100009] = {};
const long long int INF = 1e17;
void Inp() {
  cin >> a;
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= a; j++) {
      cin >> x[i][j];
      z[j] += x[i][j];
    }
  }
}
void Solve() {
  fill_n(&y[0][0][0], sizeof(y) / sizeof(y[0][0][0]), -INF);
  y[0][1][1] = 0;
  for (int i = 1; i < a; i++) {
    for (int pre = 1; pre <= 4; pre++) {
      for (int now = 1; now <= 4; now++) {
        if (pre == 4 && now == 4) {
          for (int j = 1; j <= 3; j++) {
            if (y[i - 1][pre][j] != -INF) {
              y[i][now][j] = max(y[i][now][j], y[i - 1][pre][j] + z[i]);
            }
          }
          continue;
        }
        if ((pre == 4 && now == 2) || (pre == 2 && now == 4)) {
          continue;
        }
        if (now == 4) {
          if (y[i - 1][pre][pre] != -INF) {
            y[i][now][pre] = max(y[i][now][pre], y[i - 1][pre][pre] + z[i]);
          }
          continue;
        }
        if (pre == 4) {
          y[i][now][now] = max(y[i][now][now], y[i - 1][pre][4 - now] + z[i]);
          continue;
        }
        c = min(now, pre);
        d = max(now, pre);
        e = 0;
        for (int j = c; j <= d; j++) {
          e = e + x[j][i];
        }
        y[i][now][now] = max(y[i][now][now], y[i - 1][pre][pre] + e);
      }
    }
  }
  long long int kq = 0;
  kq = max(max(y[a - 1][1][1] + z[a], y[a - 1][2][2] + x[2][a] + x[3][a]),
           max(y[a - 1][3][3] + x[3][a], y[a - 1][4][1] + z[a]));
  cout << kq;
}
int main() {
  Inp();
  Solve();
}
