You are given a rectangular table 3 × n. Each cell contains an integer. You can move from one cell to another if they share a side.

Find such path from the upper left cell to the bottom right cell of the table that doesn't visit any of the cells twice, and the sum of numbers written in the cells of this path is maximum possible.

Input

The first line contains an integer n (1 ≤ n ≤ 105) — the number of columns in the table.

Next three lines contain n integers each — the description of the table. The j-th number in the i-th line corresponds to the cell aij ( - 109 ≤ aij ≤ 109) of the table.

Output

Output the maximum sum of numbers on a path from the upper left cell to the bottom right cell of the table, that doesn't visit any of the cells twice.

Examples

Input

3
1 1 1
1 -1 1
1 1 1


Output

7


Input

5
10 10 10 -1 -1
-1 10 10 10 10
-1 10 10 10 10


Output

110

Note

The path for the first example:

<image>

The path for the second example:

<image>
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:10000000000")
using namespace std;
void print_str(const char *s) {
  while (*s != 0) {
    putchar(*s);
    s++;
  }
}
template <typename T>
void scan(T &t) {
  cin >> t;
}
template <>
void scan<int>(int &t) {
  scanf("%d", &t);
}
template <>
void scan<long long>(long long &t) {
  scanf("%I64d", &t);
}
template <>
void scan<string>(string &t) {
  cin >> t;
}
template <>
void scan<char *>(char *&t) {
  scanf("%s", t);
}
template <>
void scan<char>(char &t) {
  t = getchar();
  while (t <= 32) t = getchar();
}
template <typename T>
void scan(vector<T> &t) {
  for (int i = 0; i < t.size(); i++) {
    scan(t[i]);
  }
}
template <typename T, typename... Ts>
void scan(T &t, Ts &...ts) {
  scan(t);
  scan(ts...);
}
template <typename T>
void print(T t) {
  cout << t;
}
template <>
void print<string>(string s) {
  print_str(s.c_str());
}
template <>
void print<int>(int t) {
  printf("%d", t);
}
template <>
void print<long long>(long long t) {
  printf("%I64d", t);
}
template <>
void print<char>(char t) {
  putchar(t);
}
template <>
void print<const char *>(const char *t) {
  print_str(t);
}
template <typename T>
void print(pair<T, T> t) {
  printf("(");
  print(t.first);
  printf(", ");
  print(t.second);
  printf(")");
}
template <typename T, typename... Ts>
void print(T t, Ts... ts) {
  print(t);
  print(ts...);
}
const int INF = 1e9;
const long long LINF = 3e18;
const int maxN = 1e5 + 100;
const int maxM = 58;
const int SIZE = (1 << 17);
const int mb = 30;
const long long MOD = 101234567897;
const long long P = 127;
const double EPS = 1e-8;
mt19937_64 random_generator;
int random(int l, int r, int q = 0) {
  uniform_int_distribution<int> dist(l, r);
  long long res = dist(random_generator);
  return res;
}
namespace solution {}
namespace bruteforce {}
void init(bool testing = false) {}
void gen(int seed) {}
long long d[maxN][5];
long long a[3][maxN];
int t[5][5] = {{1, 1, 1, 1, 0},
               {1, 1, 1, 0, 0},
               {1, 1, 1, 0, 1},
               {1, 1, 1, 1, 1},
               {1, 1, 1, 1, 1}};
int main() {
  int n;
  scan(n);
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < n; j++) {
      scan(a[i][j]);
    }
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < 5; j++) {
      d[i][j] = -LINF;
    }
  }
  d[1][0] = a[0][0];
  d[1][1] = a[0][0] + a[1][0];
  d[1][2] = d[1][3] = a[0][0] + a[1][0] + a[2][0];
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j < 5; j++) {
      for (int k = 0; k < 5; k++) {
        if (!t[j][k]) continue;
        if (j == 3) {
          if (k == 0) {
            long long sum = a[0][i - 1] + a[1][i - 1] + a[2][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          } else if (k == 1) {
            long long sum = a[1][i - 1] + a[2][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          } else if (k == 2) {
            long long sum = a[2][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          } else if (k == 3) {
            long long sum = a[0][i - 1] + a[1][i - 1] + a[2][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          } else if (k == 4) {
            long long sum = a[0][i - 1] + a[1][i - 1] + a[2][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          }
        } else if (j == 4) {
          if (k == 0) {
            long long sum = a[0][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          } else if (k == 1) {
            long long sum = a[1][i - 1] + a[0][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          } else if (k == 2) {
            long long sum = a[2][i - 1] + a[1][i - 1] + a[0][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          } else if (k == 3) {
            long long sum = a[0][i - 1] + a[1][i - 1] + a[2][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          } else if (k == 4) {
            long long sum = a[0][i - 1] + a[1][i - 1] + a[2][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          }
        } else if (j <= 2 && k <= 2) {
          if (j == 0 && k == 2 || j == 2 && k == 0) {
            long long sum = a[0][i - 1] + a[1][i - 1] + a[2][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          } else if (j == 0 && k == 1 || j == 1 && k == 0) {
            long long sum = a[0][i - 1] + a[1][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          } else if (j == 1 && k == 2 || j == 2 && k == 1) {
            long long sum = a[1][i - 1] + a[2][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          } else if (j == k) {
            long long sum = a[j][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          }
        } else if (j <= 2) {
          if (k == 3 || k == 4) {
            long long sum = a[0][i - 1] + a[1][i - 1] + a[2][i - 1];
            d[i][k] = max(d[i][k], d[i - 1][j] + sum);
          }
        }
      }
    }
  }
  print(max(d[n][2], d[n][3]));
  return 0;
}
