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.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.ArrayList;
import java.math.BigInteger;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Iterator;
import java.lang.StringBuilder;
import java.util.Map;

public class Main{
  public static class InputReader {
    BufferedReader reader;
    StringTokenizer tokenizer;
    
    public InputReader(InputStream stream){
      reader = new BufferedReader(new InputStreamReader(stream));
    }
    
    public String next(){
      while(tokenizer == null || !tokenizer.hasMoreTokens()){
        try{
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException ioe) {
          throw new RuntimeException(ioe);
        }
      }
      return tokenizer.nextToken();
    }
    
    public int nextInt(){
      return Integer.parseInt(next());
    }
    
    public long nextLong(){
      return Long.parseLong(next());
    }
    
    public double nextDouble(){
      return Double.parseDouble(next());
    }
    
    public BigInteger nextBigInteger(){
      return new BigInteger(next());
    }
    
    public String nextLine(){
      try{
        return reader.readLine();
      } catch(IOException ioe){
        throw new RuntimeException();
      }
    }
  }
  
  public static final long INF = Long.MAX_VALUE/2;
// public static final long INF = 7;
  
  public static long max3(long a, long b, long c){
    return Math.max(a, Math.max(b,c));
  }
  
  public static long solve(int n, long[][] t){
    long[][] dp = new long[n][9];
    /*
    0 1 2 3 4 5 6 7 8
    o o @ x x @ x o x
    x @ o o o @ x @ @
    x @ x x @ o o x o
    */
    
    /*
    10 10 10 -1 -1
    -1 10 10 10 10
    -1 10 10 10 10
    */
    dp[0][0] = t[0][0];
    dp[0][1] = dp[0][3] = dp[0][4] = dp[0][6] = dp[0][7]= dp[0][8]=-INF;
    dp[0][2] = dp[0][0] + t[0][1];
    dp[0][5] = dp[0][2] + t[0][2];
    for(int i=1; i<n;++i){
      long s1 = t[i][0];
      long s2 = s1 + t[i][1];
      long s3 = s2 + t[i][2];
      long s4 = s3 - t[i][0];
      long s5 = s4 - t[i][1];
      long ep1 = max3(dp[i-1][0], dp[i-1][1], dp[i-1][7]);
      long ep2 = max3(dp[i-1][2], dp[i-1][3], dp[i-1][4]);
      long ep3 = max3(dp[i-1][5], dp[i-1][6], dp[i-1][8]);
      dp[i][0] = ep1 + s1;
      dp[i][1] = ep3 + s3;
      dp[i][1] = Math.max(dp[i][1], dp[i-1][6] + s3 + t[i-1][0] + t[i-1][1]);
      dp[i][2] = ep1 + s2;
      dp[i][3] = ep2 + t[i][1];
      dp[i][4] = ep3 +s4;
      dp[i][5] = ep1 + s3; //
      dp[i][5] = Math.max(dp[i][5], dp[i-1][0] + s3 + t[i-1][2] + t[i-1][1]);
      dp[i][6] = ep3 + s5;
      dp[i][7] = ep2 + s2;
      dp[i][8] = ep2 + s4;
    }
//     for(int j=0;j<n;++j){
//       for(int i=0;i<9;++i){
//         if(dp[j][i] > -INF/2){
//           System.out.printf("%3d ", dp[j][i]);
//         } else {
//           System.out.printf("### ");
//         }
//       }
//       System.out.println();
//     }
    return max3(dp[n-1][5], dp[n-1][6], dp[n-1][8]);
    
  }
  
  public static void main(String[] args){
    InputReader reader = new InputReader(System.in);
    PrintWriter pw = new PrintWriter(System.out);
    int n = reader.nextInt();
    long[][] t = new long[n][3];
    for(int j=0;j<3;++j){
      for(int i=0; i<n; ++i){
        t[i][j] = reader.nextInt();
      }
    }
    
    pw.printf("%d\n", solve(n,t));
    pw.flush();
    pw.close();
  }
  
}