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>
import java.io.*;
import java.util.*;

public class Main {
	static long INF = (long)1e18;
	static long[][] board;
	static long[][][] memo;
	static long[] SUM_OF_COL;
	public static int COL;
  public static void main(String[] args) throws IOException {
  	FastScanner in = new FastScanner(System.in);
  	int cols = in.nextInt();
  	COL = cols;
  	board = new long[3][cols];
  	SUM_OF_COL = new long[cols];
  	for (int i = 0; i < 3; i++) {
  		for (int j = 0; j < cols; j++) {
  			board[i][j] = in.nextInt();
  			// System.out.print(board[i][j] + " ");
  			SUM_OF_COL[j] += board[i][j];
  		}
  		// System.out.println();
  	}
  	memo = new long[3][8][cols];
  	for (long[][] x: memo) {
  		for (long[] y:x) {
  			for (int i = 0; i < y.length; i++) {
  				y[i] = -INF;
  			}
  		}
  	}

  	System.out.println(compute(0,0,1));
  }
  
  public static boolean isBitOff(int bm, int bit){
  	return ((1<<bit) & bm) == 0;
  }
  
  public static int turnBitOn(int bm, int bit){
  	return (1<<bit) | bm;
  }
  
  public static long compute(int curRow, int curCol, int bm) {
  	if (memo[curRow][bm][curCol] != -INF) {
  		return memo[curRow][bm][curCol];
  	}
  	if (curRow == 2 && curCol == (COL-1)) {
  		return board[curRow][curCol];
  	}
  	long best = -INF;
  	int dr = curRow+1;
  	if (dr <= 2 && isBitOff(bm, dr)) {
  		best = Math.max(best, compute(dr, curCol, turnBitOn(bm, dr)));
  	}
  	int ur = curRow-1;
  	if (ur >= 0 && isBitOff(bm, ur)) {
  		best = Math.max(best, compute(ur, curCol, turnBitOn(bm, ur)));
  	}
  	
  	if (curCol + 1 < COL) {
  		best = Math.max(best, compute(curRow, curCol+1, turnBitOn(0, curRow)));
  	}
  	
  	if (curRow == 0 && bm == 1 && curCol + 1 < COL) {
  		long add_val = SUM_OF_COL[curCol] + SUM_OF_COL[curCol+1] - board[2][curCol+1] - board[curRow][curCol];
  		long specialMove = add_val + compute(2, curCol+1, 7);
  		best = Math.max(best, specialMove);
  	}
  	
  	if (curRow == 2 && bm == 4 && curCol+1 < COL) {
  		long add_val = SUM_OF_COL[curCol] + SUM_OF_COL[curCol+1] - board[0][curCol+1] - board[curRow][curCol];
  		long specialMove = add_val + compute(0, curCol+1, 7);
  		best = Math.max(best, specialMove);
  	}
	
		best += board[curRow][curCol];
		best = Math.max(best, -INF + 1);
  	return memo[curRow][bm][curCol] = best;
  }
  
  static class FastScanner {
    BufferedReader br;
    StringTokenizer st;
    
    public FastScanner(InputStream in) {
      br = new BufferedReader(new InputStreamReader(in));
      st = new StringTokenizer("");
    }
    
    public int nextInt() throws IOException {
      return Integer.parseInt(next());
    }
    
    public String next() throws IOException {
      if (st.hasMoreTokens()) return st.nextToken();
      st = new StringTokenizer(br.readLine());
      return next();
    }
  }
}