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;
int64_t seed;
mt19937 rng(seed = chrono::steady_clock::now().time_since_epoch().count());
inline int64_t rnd(int64_t l = 0, int64_t r = numeric_limits<int64_t>::max()) {
  return uniform_int_distribution<int64_t>(l, r)(rng);
}
template <typename T, typename G>
ostream& operator<<(ostream& out, const pair<T, G>& a) {
  return out << "( " << a.first << ", " << a.second << ")";
}
template <typename T>
ostream& operator<<(ostream& out, const vector<T>& a) {
  out << "[ ";
  for (const auto& i : a) out << i << ", ";
  return out << "]" << endl;
}
template <typename T>
ostream& operator<<(ostream& out, const set<T>& a) {
  out << "{ ";
  for (const auto& i : a) out << i << ", ";
  return out << "}" << endl;
}
template <typename T, typename G>
ostream& operator<<(ostream& out, const map<T, G>& a) {
  out << "< ";
  for (const auto& i : a) out << i << ", ";
  return out << ">" << endl;
}
template <typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
                   ostream&>::type
operator<<(ostream& out, T (&a)[N]) {
  out << "[ ";
  for (const auto& i : a) out << i << ", ";
  return out << "]" << endl;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << (H) << ' ';
  debug_out(T...);
}
const int64_t inf = 2e15;
vector<vector<int64_t> > a;
vector<vector<vector<int64_t> > > dp, vis;
int64_t calc(int64_t row, int64_t col, int64_t zigzag) {
  if (col == a[0].size()) {
    if (row == 2) return 0;
    return -inf;
  }
  int64_t& val = dp[row][col][zigzag];
  if (vis[row][col][zigzag]) return val;
  vis[row][col][zigzag] = 1;
  int64_t col_sum = a[0][col] + a[1][col] + a[2][col];
  if (zigzag) {
    val = max(val, calc(row, col + 1, 1) + col_sum);
    if (row == 0) {
      for (int64_t i = 0, sum = 0; i < 3; ++i) {
        sum += a[i][col];
        val = max(val, calc(i, col + 1, 0) + sum);
      }
    } else {
      for (int64_t i = 2, sum = 0; i >= 0; --i) {
        sum += a[i][col];
        val = max(val, calc(i, col + 1, 0) + sum);
      }
    }
    return val;
  }
  if (row == 0) {
    for (int64_t i = 0, sum = 0; i < 3; ++i) {
      sum += a[i][col];
      val = max(val, calc(i, col + 1, 0) + sum);
    }
  } else if (row == 2) {
    for (int64_t i = 2, sum = 0; i >= 0; --i) {
      sum += a[i][col];
      val = max(val, calc(i, col + 1, 0) + sum);
    }
  } else {
    val = max(val, calc(0, col + 1, 0) + a[1][col] + a[0][col]);
    val = max(val, calc(1, col + 1, 0) + a[1][col]);
    val = max(val, calc(2, col + 1, 0) + a[1][col] + a[2][col]);
    return val;
  }
  val = max(val, calc(2 - row, col + 1, 1) + col_sum);
  return val;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int64_t n;
  cin >> n;
  a.assign(3, vector<int64_t>(n));
  dp.assign(3, vector<vector<int64_t> >(n, vector<int64_t>(2, -inf)));
  vis.assign(3, vector<vector<int64_t> >(n, vector<int64_t>(2, 0)));
  for (int64_t i = 0; i < 3; ++i)
    for (int64_t j = 0; j < n; ++j) cin >> a[i][j];
  cout << calc(0, 0, 0) << '\n';
  return 0;
}
