Gargari is jealous that his friend Caisa won the game from the previous problem. He wants to prove that he is a genius.

He has a n × n chessboard. Each cell of the chessboard has a number written on it. Gargari wants to place two bishops on the chessboard in such a way that there is no cell that is attacked by both of them. Consider a cell with number x written on it, if this cell is attacked by one of the bishops Gargari will get x dollars for it. Tell Gargari, how to place bishops on the chessboard to get maximum amount of money.

We assume a cell is attacked by a bishop, if the cell is located on the same diagonal with the bishop (the cell, where the bishop is, also considered attacked by it).

Input

The first line contains a single integer n (2 ≤ n ≤ 2000). Each of the next n lines contains n integers aij (0 ≤ aij ≤ 109) — description of the chessboard.

Output

On the first line print the maximal number of dollars Gargari will get. On the next line print four integers: x1, y1, x2, y2 (1 ≤ x1, y1, x2, y2 ≤ n), where xi is the number of the row where the i-th bishop should be placed, yi is the number of the column where the i-th bishop should be placed. Consider rows are numbered from 1 to n from top to bottom, and columns are numbered from 1 to n from left to right.

If there are several optimal solutions, you can print any of them.

Examples

Input

4
1 1 1 1
2 1 1 0
1 1 1 0
1 0 0 1


Output

12
2 2 3 2
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

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

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[][] map = in.nextIntMap(0, 0, n, n);
            long[][] diagonalSum = new long[2][2 * n - 1];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    diagonalSum[0][distance(i, j, n - 1, 0)] += map[i][j];
                    diagonalSum[1][distance(i, j, n - 1, n - 1)] += map[i][j];
                }
            }
            long[] sum = new long[2 * n + 1];
            Arrays.fill(sum, -1);
            Pair<Integer, Integer>[] xy = new Pair[2 * n + 1];
            for (int i = 0, x = n - 1, y = 0; i < 2 * n - 1; i++, y += (x == 0 ? 1 : 0), x += (x == 0 ? 0 : -1)) {
                int _x = x, _y = y;
                while (_x < n && _y < n) {
                    long localSum = diagonalSum[0][i] + diagonalSum[1][distance(_x, _y, n - 1, n - 1)] - map[_x][_y];
                    if (localSum > sum[i]) {
                        sum[i] = localSum;
                        xy[i] = new Pair<>(_x + 1, _y + 1);
                    }
                    _x += 1;
                    _y += 1;
                }
            }
            int iMax = 0, jMax = 1;
            for (int i = 0; i < 2 * n + 1; i++) {
                for (int j = i + 1; j < 2 * n + 1; j += 2) {
                    if (sum[i] + sum[j] > sum[iMax] + sum[jMax]) {
                        iMax = i;
                        jMax = j;
                    }
                }
            }
            out.println(sum[iMax] + sum[jMax]);
            out.println(xy[iMax].first + " " + xy[iMax].second + " " + xy[jMax].first + " " + xy[jMax].second);
        }

        int distance(int x1, int y1, int x2, int y2) {
            return Math.abs(x1 - x2) + Math.abs(y1 - y2);
        }

    }

    static class Pair<U, V> {
        public U first;
        public V second;

        public Pair() {
        }

        public Pair(U first, V second) {
            this.first = first;
            this.second = second;
        }


        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!first.equals(pair.first)) return false;
            return second.equals(pair.second);
        }


        public int hashCode() {
            int result = first.hashCode();
            result = 31 * result + second.hashCode();
            return result;
        }


        public String toString() {
            return "Pair{" + "first=" + first + ", second=" + second + '}';
        }

    }

    static class InputReader {
        private StringTokenizer tokenizer;
        private BufferedReader reader;

        public InputReader(InputStream inputStream) {
            reader = new BufferedReader(new InputStreamReader(inputStream));
        }

        private void fillTokenizer() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        }

        public String next() {
            fillTokenizer();
            return tokenizer.nextToken();
        }

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

        public int[] nextIntArray(int offset, int length) {
            int[] arr = new int[offset + length];
            for (int i = offset; i < offset + length; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public int[][] nextIntMap(int offsetRows, int offsetCols, int rowsLength, int colsLength) {
            int[][] map = new int[offsetRows + rowsLength][];
            for (int i = offsetRows; i < offsetRows + rowsLength; i++) {
                map[i] = nextIntArray(offsetCols, colsLength);
            }
            return map;
        }

    }
}

