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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Gargari_And_Bishops {

    /**
     * @param args
     * @throws IOException
     * @throws NumberFormatException
     */
    public static void main(String[] args) throws NumberFormatException,
            IOException {
        // TODO Auto-generated method stub
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        long a[][] = new long[N][N];
        long value[][] = new long[N][N];
        int visited[][] = new int[N][N];
        for (int i = 0; i < N; i++) {
            StringTokenizer st = new StringTokenizer(br.readLine());
            for (int j = 0; j < N; j++) {
                a[i][j] = Long.parseLong(st.nextToken());
            }
        }
        long max_value1 = -1, max_value2 = -1;
        int x1 = -1, x2 = -2, y1 = -10, y2 = -3;
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                if (visited[i][j] >= 2)
                    continue;
                // visited[i][j]++;
                long x = 0;
                ArrayList<Integer> al = new ArrayList<Integer>();
                // al.add(i);al.add(j);
                for (int k = i, l = j; k < N && l < N; k++, l++) {
                    x += a[k][l];
                    visited[k][l]++;
                    al.add(k);
                    al.add(l);
                }
                for (int k = 0; k < al.size() - 1; k += 2) {
                    int ith = al.get(k);
                    int jth = al.get(k + 1);
                    value[ith][jth] += x - a[ith][jth];
                }
                al = new ArrayList<Integer>();
                x = 0;
                // al.add(i);al.add(j);
                for (int k = i, l = j; k < N && l > -1; k++, l--) {
                    x += a[k][l];
                    visited[k][l]++;
                    al.add(k);
                    al.add(l);
                }
                for (int k = 0; k < al.size() - 1; k += 2) {
                    int ith = al.get(k);
                    int jth = al.get(k + 1);
                    value[ith][jth] += x - a[ith][jth];
                }

            }
        }
        // int k = 0;
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                // System.out.print(value[i][j]+" ");
                a[i][j] += value[i][j];
                long x=getAbsolute(i-x1);long y=getAbsolute(j-y1);
                long w=getAbsolute(i-x2);long z=getAbsolute(j-y2);
                
                if (max_value1 <= a[i][j]){
                    if((((x&1)==1 && (y&1)==0)
                        || ((x&1)==0 && (y&1)==1))){
                    max_value2 = max_value1;
                    x2 = x1;
                    y2 = y1;
                    max_value1 = a[i][j];
                    x1 = i;
                    y1 = j;
                    }
                    else if((((w&1)==1 && (z&1)==0)
                            || ((w&1)==0 && (z&1)==1))){
                        max_value1 = a[i][j];
                        x1 = i;
                        y1 = j;
                    }
                }
                else if(max_value2<=a[i][j]){
                    if((((x&1)==1 && (y&1)==0)
                            || ((x&1)==0 && (y&1)==1))){
                        max_value2=a[i][j];
                        x2=i;
                        y2=j;
                    }
                }
            //  System.out.print(a[i][j] + " ");
                //System.out.println(++k + " " + x1 + " " + y1 + " " + x2 + " "
                //+ y2+" "+max_value1+" "+max_value2);
            }
            //System.out.println();
        }
        System.out.println(max_value1 + max_value2);
        System.out.println(x1 + 1 + " " + (y1 + 1) + " " + (x2 + 1) + " "
                + (y2 + 1));
    }

    public static long getAbsolute(long a) {
        return Math.abs(a);
    }
}
/*
1 1 1 1 
0 1 2 1 
2 1 2 1 
1 1 1 1 
*/
/*
4
0 0 0 1
0 0 1 0
0 1 0 0
1 0 0 0
*/