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.InputStreamReader;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.BufferedReader;
import java.io.InputStream;

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

    static class TaskD {
        public void solve(int testNumber, FastReader in, OutputWriter out) {
            int n = in.nextInt();
            long[][] mat = new long[3][n];
            long[][] f = new long[3][n];

            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < n; j++) {
                    mat[i][j] = in.nextLong();
                }
            }

            f[0][0] = mat[0][0];
            f[1][0] = mat[1][0] + mat[0][0];
            f[2][0] = mat[2][0] + mat[1][0] + mat[0][0];

            for (int i = 1; i < n; ++i) {

                f[0][i] = f[0][i - 1] + mat[0][i];
                f[0][i] = Math.max(f[0][i], f[1][i - 1] + mat[1][i] + mat[0][i]);
                f[0][i] = Math.max(f[0][i], f[2][i - 1] + mat[2][i] + mat[1][i] + mat[0][i]);

                f[1][i] = f[1][i - 1] + mat[1][i];
                f[1][i] = Math.max(f[1][i], f[0][i - 1] + mat[0][i] + mat[1][i]);
                f[1][i] = Math.max(f[1][i], f[2][i - 1] + mat[2][i] + mat[1][i]);

                f[2][i] = f[2][i - 1] + mat[2][i];
                f[2][i] = Math.max(f[2][i], f[1][i - 1] + mat[1][i] + mat[2][i]);
                f[2][i] = Math.max(f[2][i], f[0][i - 1] + mat[0][i] + mat[1][i] + mat[2][i]);

                long snake = mat[0][i] + mat[0][i - 1] + mat[1][i] + mat[1][i - 1] + mat[2][i] + mat[2][i - 1];

                if (i >= 2) {
                    f[0][i] = Math.max(f[0][i], f[2][i - 2] + snake);
                    f[2][i] = Math.max(f[2][i], f[0][i - 2] + snake);
                } else {
                    f[0][i] = Math.max(f[0][i], snake);
                    f[2][i] = Math.max(f[2][i], snake);
                }
            }

            out.println(f[2][n - 1]);
        }

    }

    static class FastReader {
        BufferedReader bf;
        StringTokenizer st;

        public FastReader(InputStream is) {
            bf = new BufferedReader(new InputStreamReader(is));
            st = null;
        }

        public String next() {
            try {
                while (st == null || !st.hasMoreTokens()) {
                    String line = bf.readLine();
                    if (line == null) return null;
                    st = new StringTokenizer(line);
                }
            } catch (Exception e) {
            }

            return st.nextToken();
        }

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

        public long nextLong() {
            return Long.parseLong(next());
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

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

        public void println(long i) {
            writer.println(i);
        }

    }
}

