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.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.Arrays;

/**
 * User: dmitryt
 * Date: 04/07/2015
 */
public class CF762D {

    private static int nextInt(StreamTokenizer st) throws Exception {
        int token = st.nextToken();
        while (token != StreamTokenizer.TT_NUMBER) token = st.nextToken();
        return (int)st.nval;
    }

    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StreamTokenizer st = new StreamTokenizer(in);

        int n = nextInt(st);
        int[][] c = new int[3][n];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < n; j++) {
                c[i][j] = nextInt(st);
            }
        }

        final int MAX_STATE = 13;

        long[][] d = new long[n+1][MAX_STATE];

        for (int j = 0; j < n; j++) {
            for (int i = 0; i < MAX_STATE; i++) {
                d[j][i] = Long.MIN_VALUE;
            }
        }
        /*
         0, 1, 2 - from up ->
         3, 4, 5 - from middle ->
         6, 7, 8 - from bottom ->
         9 - from up and back -> bottom
         10 - from bottom and back -> up
         11 - from up to middle and back (closing the loop), exit bottom
         12 - from bottom to middle and back (closing the loop), exit up
         */

        /*
         trans cells
         */
        int[][] cells = new int[][] {
                {0}, {0,1}, {0,1,2}, {0,1}, {1}, {1,2}, {0,1,2}, {1,2}, {2}, {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2}
        };

        /*
         state transitions
         0, 3, 6, 12 -> 0, 1, 2, 9
         1, 4, 7 -> 3, 4, 5
         2, 5, 8, 11 -> 6, 7, 8, 10
         9 -> 9, 11
         10 -> 10, 12
         */
        int[][] trans = new int[][] {
                {0, 1, 2, 9},
                {3, 4, 5},
                {6, 7, 8, 10},
                {0, 1, 2, 9},
                {3, 4, 5},
                {6, 7, 8, 10},
                {0, 1, 2, 9},
                {3, 4, 5},
                {6, 7, 8, 10},
                {9, 11},
                {10, 12},
                {6, 7, 8, 10},
                {0, 1, 2, 9}
        };

        for (int j = 0; j < n; j++) {
            for (int i = 0; i < MAX_STATE; i++) {
                if (j == 0 && i > 0) continue;
                long prevStateCost = j == 0 ? 0 : d[j - 1][i];
                if (prevStateCost == Long.MIN_VALUE) continue;

                for (int state: trans[i]) {
                    long add = 0;
                    for (int cell: cells[state]) {
                        add += c[cell][j];
                    }

                    d[j][state] = Math.max(d[j][state], prevStateCost + add);
                }
            }
        }

        System.out.println(Arrays.stream(new long[]{d[n-1][2], d[n-1][5], d[n-1][8], d[n-1][11]}).max().getAsLong());
    }
}