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