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;
int n;
long long a[4][100005], res, f[100005][2][2][2][2][2];
void Enter() {
  cin >> n;
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }
}
bool check(int a, int b, int c) {
  if (a % 2 != 0 || b % 2 != 0 || c % 2 != 0) return false;
  if (b == 4) return false;
  return true;
}
bool Check(int a1, int b, int c, int id) {
  if (a1 > 0) res += a[1][id];
  if (b > 0) res += a[2][id];
  if (c > 0) res += a[3][id];
  if (id != n) {
    if (a1 > 2 || b > 2 || c > 2) return false;
    if (a1 + b + c == 0 || a1 + b + c == 6) return false;
    return true;
  } else {
    if (a1 % 2 != 0 || b % 2 != 0 || c != 1) return false;
    return true;
  }
}
void Solve() {
  for (int i = 1; i <= n; i++) {
    for (int hor1 = 0; hor1 <= 1; hor1++) {
      for (int hor2 = 0; hor2 <= 1; hor2++) {
        for (int hor3 = 0; hor3 <= 1; hor3++) {
          for (int ver1 = 0; ver1 <= 1; ver1++) {
            for (int ver2 = 0; ver2 <= 1; ver2++) {
              f[i][hor1][hor2][hor3][ver1][ver2] = -1e18;
            }
          }
        }
      }
    }
  }
  for (int ver1 = 0; ver1 <= 1; ver1++) {
    for (int ver2 = 0; ver2 <= 1; ver2++) {
      if (ver2 == 1)
        f[1][1][0][0][ver1][ver2] = a[1][1] + a[2][1] + a[3][1];
      else {
        if (ver1 == 0)
          f[1][1][0][0][0][0] = a[1][1];
        else
          f[1][1][0][0][1][0] = a[1][1] + a[2][1];
      }
    }
  }
  for (int i = 2; i <= n; i++) {
    for (int hor1 = 0; hor1 <= 1; hor1++) {
      for (int hor2 = 0; hor2 <= 1; hor2++) {
        for (int hor3 = 0; hor3 <= 1; hor3++) {
          for (int ver1 = 0; ver1 <= 1; ver1++) {
            for (int ver2 = 0; ver2 <= 1; ver2++) {
              res = 0;
              if (Check(hor1 + ver1, hor2 + ver1 + ver2, hor3 + ver2, i) ==
                      false ||
                  (hor1 + hor2 + hor3 == 0))
                continue;
              for (int hor4 = 0; hor4 <= 1; hor4++) {
                for (int hor5 = 0; hor5 <= 1; hor5++) {
                  for (int hor6 = 0; hor6 <= 1; hor6++) {
                    for (int ver3 = 0; ver3 <= 1; ver3++) {
                      for (int ver4 = 0; ver4 <= 1; ver4++) {
                        if (check(hor1 + hor4 + ver3, hor2 + hor5 + ver3 + ver4,
                                  hor3 + hor6 + ver4) == false ||
                            (hor5 + hor4 + hor6 == 0))
                          continue;
                        if (f[i - 1][hor4][hor5][hor6][ver3][ver4] != -1e18)
                          f[i][hor1][hor2][hor3][ver1][ver2] =
                              max(f[i][hor1][hor2][hor3][ver1][ver2],
                                  f[i - 1][hor4][hor5][hor6][ver3][ver4] + res);
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  long long kq = -1e18;
  for (int hor1 = 0; hor1 <= 1; hor1++) {
    for (int hor2 = 0; hor2 <= 1; hor2++) {
      for (int hor3 = 0; hor3 <= 1; hor3++) {
        for (int ver1 = 0; ver1 <= 1; ver1++) {
          for (int ver2 = 0; ver2 <= 1; ver2++) {
            if (f[n][hor1][hor2][hor3][ver1][ver2] != -1e18)
              kq = max(kq, f[n][hor1][hor2][hor3][ver1][ver2]);
          }
        }
      }
    }
  }
  cout << kq;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  Enter();
  Solve();
}
