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.util.*;
import java.io.*;
public class army
{
 
    
    /********* SOLUTION STARTS HERE ************/
 

    private static void solve(FastScanner s1, PrintWriter out){
        int n = s1.nextInt();
        long a[][] = new long[3][100100];
        for (int i=0;i<3;++i){
            for(int j=0;j<n;++j){
                a[i][j] = s1.nextLong();
            }
        }
        long dp[][] = new long[3][100100];
        for (int i=0;i<3;++i){
            for(int j=0;j<=n;++j){
                dp[i][j] = -10000000000000000L;
            }
        }
        long s = 0L;
        dp[0][0] = 0L;
        
        for (int i = 0; i < n; i++) {
            dp[0][i+1] = max(dp[0][i + 1], dp[0][i] + a[0][i],dp[1][i] + a[1][i] + a[0][i],dp[2][i] + a[2][i] + a[1][i] + a[0][i]);
            dp[1][i+1] = max(dp[1][i + 1], dp[0][i] + a[0][i] + a[1][i],dp[1][i] + a[1][i],dp[2][i] + a[2][i] + a[1][i]);
            dp[2][i+1] = max(dp[2][i + 1], dp[0][i] + a[0][i] + a[1][i] + a[2][i], dp[1][i] + a[1][i] + a[2][i],dp[2][i] + a[2][i]);
     
             if (i + 2 <= n) {
                s = a[0][i] + a[1][i] + a[2][i] + a[0][i + 1] + a[1][i + 1] + a[2][i + 1];
               
                dp[0][i + 2] = max(dp[0][i + 2], dp[0][i] + s);
                dp[0][i + 2] = max(dp[0][i + 2], dp[2][i] + s);
                dp[2][i + 2] = max(dp[2][i + 2], dp[0][i] + s);
                dp[2][i + 2] = max(dp[2][i + 2], dp[2][i] + s);
          
            }
        }

    System.out.println(dp[2][n]);
      
}
    
    public static long max(long first, long... rest) {
        long ret = first;
        for (long val : rest) {
            ret = Math.max(ret, val);
        }
        return ret;
    }
    
 
    
    /************* SOLUTION ENDS HERE **********/
    
    
    
    
    
    /********** TEMPLATE STARTS HERE ***********/
 
    public static void main(String []args) throws IOException {
    FastScanner in  = new FastScanner(System.in);
    PrintWriter out = 
        new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false); 
    solve(in, out);
    in.close();
    out.close();
    }    
 
    static class FastScanner{
    BufferedReader reader;
    StringTokenizer st;
    FastScanner(InputStream stream){reader=new BufferedReader(new InputStreamReader(stream));st=null;}  
    String next()
        {while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}            
         st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
    String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}             
    int    nextInt()   {return Integer.parseInt(next());}
    long   nextLong()  {return Long.parseLong(next());}     
    double nextDouble(){return Double.parseDouble(next());}
    char   nextChar()  {return next().charAt(0);}
    int[]  nextIntArray(int n)         {int[] arr= new int[n];   int i=0;while(i<n){arr[i++]=nextInt();}  return arr;}
    long[] nextLongArray(int n)        {long[]arr= new long[n];  int i=0;while(i<n){arr[i++]=nextLong();} return arr;}  
    int[]  nextIntArrayOneBased(int n) {int[] arr= new int[n+1]; int i=1;while(i<=n){arr[i++]=nextInt();} return arr;}          
    long[] nextLongArrayOneBased(int n){long[]arr= new long[n+1];int i=1;while(i<=n){arr[i++]=nextLong();}return arr;}          
    void   close(){try{reader.close();}catch(IOException e){e.printStackTrace();}}              
    }
 
    /*********** TEMPLATE ENDS HERE *************/
}