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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.Reader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.BufferedReader;
import java.util.NoSuchElementException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Ruins He
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        private static final int m = 3;
        private static final long INF = 0x3F3F3F3F3F3F3F3FL;
        private static final int[][][] matrix = new int[][][]{
                {{1}, {2, 1}},
                {{0}, {2}},
                {{1}, {0, 1}}
        };

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            int[][] mp = new int[n][3];
            for (int j = 0; j < 3; j++) {
                for (int i = 0; i < n; i++) {
                    if (n > 100000) {
                        mp[i][j] = j * n + i;
                    } else {
                        mp[i][j] = in.nextInt();
                    }
                }
            }

            long[][][] dp = new long[n][m][2];

            long sum = 0;
            for (int j = 0; j < m; j++) {
                sum += mp[0][j];
                for (int k = 0; k < 2; k++) {
                    dp[0][j][k] = j == 0 || k == 1 ? sum : -INF;
                }
            }

            for (int i = 1; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    dp[i][j][0] = dp[i][j][1] = dp[i - 1][j][1] + mp[i][j];
                }

                for (int j = 0; j < m; j++) {
                    for (int[] indices : matrix[j]) {
                        sum = dp[i][indices[0]][0];
                        for (int k = 1; k < indices.length; k++) {
                            sum += mp[i][indices[k]];
                        }
                        dp[i][j][1] = Math.max(dp[i][j][1], sum + mp[i][j]);
                    }
                }

                dp[i][0][1] = Math.max(dp[i][0][1], dp[i - 1][2][0] + mp[i][2] + mp[i][1] + mp[i - 1][1] + mp[i - 1][0] + mp[i][0]);
                dp[i][2][1] = Math.max(dp[i][2][1], dp[i - 1][0][0] + mp[i][0] + mp[i][1] + mp[i - 1][1] + mp[i - 1][2] + mp[i][2]);
            }

            out.println(dp[n - 1][m - 1][1]);
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        private OutputWriter(Writer writer, boolean autoFlush) {
            this.writer = new PrintWriter(new BufferedWriter(writer, 32767), autoFlush);
        }

        public OutputWriter(Writer writer) {
            this(writer, true);
        }

        public OutputWriter(OutputStream outputStream) {
            this(new OutputStreamWriter(outputStream), false);
        }

        public OutputWriter println(long value) {
            writer.println(value);
            return this;
        }

        public void close() {
            writer.close();
        }

    }

    static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer = null;

        public InputReader(Reader reader) {
            this.reader = new BufferedReader(reader, 32767);
        }

        public InputReader(InputStream inputStream) {
            this(new InputStreamReader(inputStream));
        }

        public String next() {
            if (hasNext()) return tokenizer.nextToken();
            else throw new NoSuchElementException();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public boolean hasNext() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    String nextLine = reader.readLine();
                    if (nextLine == null) return false;
                    tokenizer = new StringTokenizer(nextLine);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.hasMoreTokens();
        }

    }
}

