#include <bits/stdc++.h>
using namespace std;
constexpr long long inf = 1ll << 60;
constexpr int transitions[5][5] = {{1, 3, 7, 0, 7},
                                   {3, 2, 6, 0, 0},
                                   {7, 6, 4, 7, 0},
                                   {7, 0, 0, 7, 0},
                                   {0, 0, 7, 0, 7}};
int n, a[100005][3];
long long dp[100005][5];
int main() {
  cin >> n;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[j][i];
    }
  }
  dp[0][0] = 0;
  for (int i = 1; i < 5; i++) {
    dp[0][i] = -inf;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 5; j++) {
      dp[i][j] = -inf;
      for (int k = 0; k < 5; k++) {
        if (transitions[j][k] && dp[i - 1][k] > -inf) {
          long long val = dp[i - 1][k];
          for (int l = 0; l < 3; l++) {
            if (transitions[j][k] & (1 << l)) {
              val += a[i - 1][l];
            }
          }
          dp[i][j] = max(dp[i][j], val);
        }
      }
    }
  }
  cout << dp[n][2] << '\n';
}
