#include <bits/stdc++.h>
using namespace std;
int Q, N, M, K, L;
long long A[3][100001];
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
long long dp[3][100001];
bool visit[3][100001];
struct Go {
  long long x, y, v;
};
void adv(int x, int y, int ox, long long v, int adved, vector<Go>& r) {
  visit[y][x] = 1;
  if (x == ox + 1 && !adved) {
    r.push_back({x, y, v});
  }
  if (x == ox + 2 && !visit[y][x + 1]) {
    r.push_back({x, y, v});
  }
  if (x == ox + 3) {
    visit[y][x] = 0;
    return;
  }
  for (int i = 0; i < 4; i++) {
    int nx = x + dx[i];
    int ny = y + dy[i];
    if (nx <= ox || ny < 0 || nx >= N || ny >= 3) continue;
    if (visit[ny][nx]) continue;
    adv(nx, ny, ox, v + A[ny][nx], (adved | (nx == ox + 2)), r);
  }
  visit[y][x] = 0;
}
long long solve(int x, int y) {
  if (x == N - 1) {
    if (y == 2)
      return 0;
    else
      return -1e16;
  }
  long long& r = dp[y][x];
  if (~r) return r;
  r = -1e16;
  vector<Go> nexts;
  adv(x, y, x, 0, 0, nexts);
  for (int i = 0; i < nexts.size(); i++) {
    Go next = nexts[i];
    r = max(solve(next.x, next.y) + next.v, r);
  }
  return r;
}
int main() {
  ios::sync_with_stdio(false);
  memset(dp, -1, sizeof dp);
  cin >> N;
  for (int i = 0; i < 3; i++) {
    for (int j = 1; j <= N; j++) {
      cin >> A[i][j];
    }
  }
  N++;
  cout << solve(0, 0);
  cin >> N;
}
