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.Arrays;
import java.util.StringTokenizer;

public class D {

    static int n;
    static int arr [][];
    static long memo [][];

    static long dp (int i, int j) {
        if (j == n - 1) {
            long last = arr[2][j];
            if (i == 0) last += arr[0][j] + arr[1][j];
            if (i == 1) last += arr[1][j];
            return last;
        }

        if (j == n) return 0;

        if (memo[i][j] != - 1) {
            return memo[i][j];
        }

        long max = Long.MIN_VALUE;
        if (i == 0) {
            if (j + 2 <= n) {
                max = Math.max(max, calc(j) + dp(2, j + 2));
            }
            long sum = 0;
            for (int row = 0; row < 3; row++) {
                sum += arr[row][j];
                max = Math.max(max, sum + dp(row, j + 1));
            }
        }
        else if (i == 1) {
            max = Math.max(max, arr[i][j] + dp(i, j + 1));
            max = Math.max(max, arr[i][j] + arr[i - 1][j] + dp(i - 1, j + 1));
            max = Math.max(max, arr[i][j] + arr[i + 1][j] + dp(i + 1, j + 1));
        }
        else {
            if (j + 2 < n) {
                max = Math.max(max, calc(j) + dp(0, j + 2));
            }
            long sum = 0;
            for (int row = 2; row >= 0; row--) {
                sum += arr[row][j];
                max = Math.max(max, sum + dp(row, j + 1));
            }
        }

        return memo[i][j] = max;
    }

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        n = sc.nextInt();
        arr = new int[3][n];
        memo = new long[3][n];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < n; j++) {
                arr[i][j] = sc.nextInt();
            }
            Arrays.fill(memo[i], - 1);
        }

        out.println(dp(0,0));
        out.flush();
        out.close();
    }


    static long calc (int col) {
        long sum = 0;
        for (int row = 0; row < 3; row++) {
            for (int c = col; c <= col + 1; c++) {
                sum += arr[row][c];
            }
        }
        return sum;
    }






















    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

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

        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 {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

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

    }
}