#include <bits/stdc++.h>
using namespace std;
inline int getint() {
  int res = 0, fh = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') fh = -1, ch = getchar();
  while (ch <= '9' && ch >= '0') res = res * 10 + ch - '0', ch = getchar();
  return res * fh;
}
int n;
long long a[4][100001];
long long f[100001][6];
void up(long long &x, long long y) {
  if (y > x) x = y;
}
int main() {
  n = getint();
  for (int i = 1; i <= 3; i++)
    for (int j = 1; j <= n; j++) a[i][j] = getint();
  for (int i = 0; i <= n; i++)
    for (int j = 1; j <= 5; j++) f[i][j] = -10000000000000000LL;
  f[0][1] = 0;
  long long res;
  for (int i = 1; i <= n; i++) {
    up(f[i][1], f[i - 1][1] + a[1][i]);
    up(f[i][2], f[i - 1][2] + a[2][i]);
    up(f[i][3], f[i - 1][3] + a[3][i]);
    res = a[1][i] + a[2][i];
    up(f[i][1], f[i - 1][2] + res);
    up(f[i][2], f[i - 1][1] + res);
    res = a[2][i] + a[3][i];
    up(f[i][2], f[i - 1][3] + res);
    up(f[i][3], f[i - 1][2] + res);
    res = a[1][i] + a[2][i] + a[3][i];
    up(f[i][1], f[i - 1][3] + res);
    up(f[i][3], f[i - 1][1] + res);
    up(f[i][3], f[i - 1][4] + res);
    up(f[i][1], f[i - 1][5] + res);
    up(f[i][4], f[i - 1][1] + res);
    up(f[i][5], f[i - 1][3] + res);
  }
  printf("%I64d", f[n][3]);
  return 0;
}
