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.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {

	static final long DUMMY = Long.MAX_VALUE;
	static final long INF = (long)1e17;
	static int[][] grid;
	static int n;
	static long[][] memo;
	
	static long dp(int col, int row, int snake)
	{
		if(col == n)
			return row == 2 && snake == 0 ? 0 : -INF;
		if(memo[row << 1 | snake][col] != DUMMY)
			return memo[row << 1 | snake][col];
		long ans = 0;
		if(snake == 1)
		{
			ans += grid[0][col] + grid[1][col] + grid[2][col] - grid[row][col];
			ans += Math.max(dp(col + 1, row, snake), dp(col + 1, 2 - row, 0));
		}
		else 
		{
			//straight move
			ans = dp(col + 1, row, 0);
			if(row != 1)
				ans = Math.max(ans, dp(col + 1, row, 1) + grid[0][col] + grid[1][col] + grid[2][col] - grid[row][col]);
			if(row != 0)
				ans = Math.max(ans, dp(col + 1, row - 1, 0) + grid[row - 1][col]);
			else
				ans = Math.max(ans, dp(col + 1, row + 2, 0) + grid[row + 1][col] + grid[row + 2][col]);
			if(row != 2)
				ans = Math.max(ans, dp(col + 1, row + 1, 0) + grid[row + 1][col]);
			else
				ans = Math.max(ans, dp(col + 1, row - 2, 0) + grid[row - 1][col] + grid[row - 2][col]);
		}
		ans += grid[row][col];
		return memo[row << 1 | snake][col] = ans;
	}
	
	public static void sol() throws IOException{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		n = sc.nextInt();
		grid = new int[3][n];
		for(int i = 0; i < 3; ++i)
			for(int j = 0; j < n; ++j)
				grid[i][j] = sc.nextInt();
		memo = new long[6][n];
		for(long[] x: memo)
			Arrays.fill(x, DUMMY);
		out.println(dp(0, 0, 0));
		out.flush();
		out.close();
	}

	public static void main(String[] args) {new Thread(null, new Runnable() { public void run() {try {
		sol();
	} catch (IOException e) {
		
		e.printStackTrace();
	}}}, "2",1<<26).start();}
	
	static class Scanner 
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException 
		{
			while (st == null || !st.hasMoreTokens()) 
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();} 
	}
} 