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 int t,n,m,k,mod=998244353,maxn=300005;
    static long INF=(long)1e16;
    
    void solve(PrintWriter out, Reader in) throws IOException{
        n = in.nextInt();
        long[][] arr = new long[3][n]; 
        
        for(int i=0;i<3;i++){
            for(int j=0;j<n;j++){
                arr[i][j] = in.nextLong();
            }
        }
        
        long[][] dp = new long[3][n];
        
        dp[0][0] = arr[0][0];
        dp[1][0] = arr[1][0]+arr[0][0];
        dp[2][0] = arr[0][0]+arr[1][0]+arr[2][0];
        for(int i=0;i<3;i++){
            for(int j=1;j<n;j++) dp[i][j] =-INF;
        }
        
        long temp=0;
        int id=0;
        for(int i=1;i<n;i++){
            for(int j=0;j<3;j++){
                for(int z=0;z<3;z++){
                    id=j;
                    temp = 0;
                    while(id!=z){
                        temp+=arr[id][i];
                        if(id<z)id++;
                        else id--;
                    }
                    temp += arr[z][i];
                    dp[z][i] = Math.max(dp[z][i],dp[j][i-1]+temp);
                }
            }
            if(i>=1){
                if(i!=1){
                    dp[0][i] = Math.max(dp[0][i],dp[2][i-2]+arr[0][i-1]+arr[1][i-1]+arr[2][i-1]
                                                           +arr[0][i]+arr[1][i]+arr[2][i]);
                    dp[2][i] = Math.max(dp[2][i],dp[0][i-2]+arr[0][i-1]+arr[1][i-1]+arr[2][i-1]
                                                           +arr[0][i]+arr[1][i]+arr[2][i]);
                }else{
                    dp[0][i] = Math.max(dp[0][i],arr[0][i-1]+arr[1][i-1]+arr[2][i-1]
                                                           +arr[0][i]+arr[1][i]+arr[2][i]);
                    dp[2][i] = Math.max(dp[2][i],arr[0][i-1]+arr[1][i-1]+arr[2][i-1]
                                                           +arr[0][i]+arr[1][i]+arr[2][i]);
                }
            }
        }
        
        out.println(dp[2][n-1]);
    }
    
    static class Reader {
 
    private InputStream mIs;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
 
    public Reader() {
        this(System.in);
    }
 
    public Reader(InputStream is) {
        mIs = is;
    }
 
    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();
 
    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }
 
    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }
 
    public String next() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }
 
    double nextDouble()
    {
        return Double.parseDouble(next());
    }
 
    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }
 
    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }
 
    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }
 
    public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }
 
    }
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();
 
    }
}