#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const int N = 1e5 + 10;
long long dp[2][16];
int a[N][3];
void init(long long *dp) {
  for (int i = 0; i < 16; ++i) {
    dp[i] = -INF;
  }
}
void solve(int n) {
  long long *cur = dp[0], *nex = dp[1];
  init(cur);
  cur[2] = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 3; ++j) {
      init(nex);
      for (int k = 0; k < 16; ++k) {
        if ((k & 1) && (k & 2)) {
          nex[(k >> 1) ^ 1] = max(cur[k] + a[i][j], nex[(k >> 1) ^ 1]);
        } else if (!(k & 1) && !(k & 2)) {
          if (j != 2)
            nex[(k >> 1) | (1 << 3) | 1] =
                max(cur[k] + a[i][j], nex[(k >> 1) | (1 << 3) | 1]);
          nex[k >> 1] = max(cur[k], nex[k >> 1]);
        } else {
          if (j != 2) nex[k >> 1 | 1] = max(cur[k] + a[i][j], nex[k >> 1 | 1]);
          nex[((k >> 1) & (~1)) | (1 << 3)] =
              max(cur[k] + a[i][j], nex[((k >> 1) & (~1)) | (1 << 3)]);
        }
      }
      swap(cur, nex);
    }
  }
  printf("%I64d\n", cur[8]);
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int j = 0; j < 3; ++j) {
      for (int i = 0; i < n; ++i) scanf("%d", a[i] + j);
    }
    solve(n);
  }
  return 0;
}
