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>
using namespace std;
template <typename T>
T in() {
  char ch;
  T n = 0;
  bool ng = false;
  while (1) {
    ch = getchar();
    if (ch == '-') {
      ng = true;
      ch = getchar();
      break;
    }
    if (ch >= '0' && ch <= '9') break;
  }
  while (1) {
    n = n * 10 + (ch - '0');
    ch = getchar();
    if (ch < '0' || ch > '9') break;
  }
  return (ng ? -n : n);
}
template <typename T>
inline T POW(T B, T P) {
  if (P == 0) return 1;
  if (P & 1)
    return B * POW(B, P - 1);
  else
    return (POW(B, P / 2) * POW(B, P / 2));
}
template <typename T>
inline T Gcd(T a, T b) {
  if (a < 0) return Gcd(-a, b);
  if (b < 0) return Gcd(a, -b);
  return (b == 0) ? a : Gcd(b, a % b);
}
template <typename T>
inline T Lcm(T a, T b) {
  if (a < 0) return Lcm(-a, b);
  if (b < 0) return Lcm(a, -b);
  return a * (b / Gcd(a, b));
}
long long Bigmod(long long base, long long power, long long MOD) {
  long long ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base) % MOD;
    base = (base * base) % MOD;
    power >>= 1;
  }
  return ret;
}
bool isVowel(char ch) {
  ch = toupper(ch);
  if (ch == 'A' || ch == 'U' || ch == 'I' || ch == 'O' || ch == 'E')
    return true;
  return false;
}
template <typename T>
long long int isLeft(T a, T b, T c) {
  return (a.x - b.x) * (b.y - c.y) - (b.x - c.x) * (a.y - b.y);
}
long long ModInverse(long long number, long long MOD) {
  return Bigmod(number, MOD - 2, MOD);
}
bool isConst(char ch) {
  if (isalpha(ch) && !isVowel(ch)) return true;
  return false;
}
int toInt(string s) {
  int sm;
  stringstream second(s);
  second >> sm;
  return sm;
}
long long int dp[3][100007][3][2];
bool vs[3][100007][3][2];
long long int a[3][100007];
int n;
long long int yes(int r, int c, int dr, int fl) {
  if (c == n) {
    if (r != 2) return -1000000000000000LL;
    return 0;
  }
  long long int &res = dp[r][c][dr][fl];
  if (vs[r][c][dr][fl]) return res;
  vs[r][c][dr][fl] = true;
  res = -1000000000000000LL;
  if (r == 0) {
    if (dr == 2)
      res = max(res, yes(r, c + 1, 0, 0));
    else {
      res = max(res, yes(r, c + 1, 0, 1));
      res = max(res, yes(r + 1, c, 1, fl));
    }
  } else if (r == 1) {
    if (dr == 0) {
      res = yes(r - 1, c, 2, 0);
      res = max(res, yes(r + 1, c, 1, 0));
      res = max(res, yes(r, c + 1, 0, 0));
    } else if (dr == 1) {
      res = yes(r + 1, c, 1, 0);
      res = max(res, yes(r, c + 1, 0, 0));
      if (fl) {
        res = max(res, yes(r + 1, c + 1, 0, 0) + a[r][c - 1] + a[r + 1][c - 1] +
                           a[r + 1][c]);
      }
    } else {
      res = yes(r - 1, c, 2, 0);
      res = max(res, yes(r, c + 1, 0, 0));
      if (fl) {
        res = max(res, yes(r - 1, c + 1, 0, 0) + a[r][c - 1] + a[r - 1][c - 1] +
                           a[r - 1][c]);
      }
    }
  } else {
    if (dr == 1)
      res = max(res, yes(r, c + 1, 0, 0));
    else {
      res = max(res, yes(r, c + 1, 0, 1));
      res = max(res, yes(r - 1, c, 2, fl));
    }
  }
  res += a[r][c];
  return res;
}
int main() {
  n = in<int>();
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < n; j++) a[i][j] = in<int>();
  printf("%lld\n", yes(0, 0, 0, 0));
  return 0;
}
