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.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;



public class CF393D {

    static StringTokenizer st;
    static BufferedReader br;
    static PrintWriter pw;

    static class Sort implements Comparable<Sort> {
        int ind, a;

        @Override
        public int compareTo(Sort o) {
            return a - o.a;
        }
        public Sort(int i, int an) {
            ind = i;
            a = an;
        }
    }

    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        solve();
        pw.close();
    }
    
    static int n;
    static long[][] a;
    static long[][] d;
    
    private static void solve() throws IOException {
    	n = nextInt();
    	a = new long [3][n];
    	d = new long [3][n];
    	for (int i = 0; i < 3; ++i)
    		for (int j = 0; j < n; ++j)
    			a[i][j] = nextLong();
    	if (n == 1) {
    		pw.println(a[0][0] + a[1][0] + a[2][0]);
    		return;
    	}
    	d[0][0] = a[0][0];
    	d[1][0] = a[0][0] + a[1][0];
    	d[2][0] = a[0][0] + a[1][0] + a[2][0];
    	for (int i = 1; i < n; ++i) {
    		d[0][i] = d[0][i - 1] + a[0][i];
    		d[0][i] = Math.max(d[0][i], d[1][i - 1] + a[1][i] + a[0][i]);
    		d[0][i] = Math.max(d[0][i], d[2][i - 1] + a[2][i] + a[1][i] + a[0][i]);
    		d[1][i] = d[1][i - 1] + a[1][i];
    		d[1][i] = Math.max(d[1][i], d[0][i - 1] + a[0][i] + a[1][i]);
    		d[1][i] = Math.max(d[1][i], d[2][i - 1] + a[2][i] + a[1][i]);
    		d[2][i] = d[2][i - 1] + a[2][i];
    		d[2][i] = Math.max(d[2][i], d[1][i - 1] + a[1][i] + a[2][i]);
    		d[2][i] = Math.max(d[2][i], d[0][i - 1] + a[0][i] + a[1][i] + a[2][i]);
    			long s = a[0][i - 1] + a[0][i] + 
    					 a[1][i - 1] + a[1][i] +
    					 a[2][i - 1] + a[2][i];
    			if (i >= 2) {
    				d[0][i] = Math.max(d[2][i - 2] + s, d[0][i]);
    				d[2][i] = Math.max(d[0][i - 2] + s, d[2][i]);
    			} else {
    				d[0][i] = Math.max(s, d[0][i]);
    				d[2][i] = Math.max(s, d[2][i]);
    			}
    	}
    	pw.println(d[2][n - 1]);
    }

	private static int sumf(int[] fen, int id) {
        int summ = 0;
        for (; id >= 0; id = (id & (id + 1)) - 1)
            summ += fen[id];
        return summ;
    }

    private static void addf(int[] fen, int id) {
        for (; id < fen.length; id |= id + 1)
            fen[id]++;
    }

    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
    private static String next() throws IOException {
        while (st==null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}