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
/*
     D    A    R    K    L      _                 _         O    R    D    D    A
         K                    / |                 | \        L    O    R         D
        A         R         _ / |                 | \ _       K    L         O    R
  D         A    R    K     _ / |         _       | \ _        L    O    R    D    D
      R    K    L       _ / _   |       _ | \\    |   _ \       O    R    D    D
     R         K        _ / _   |       _ | \ \   |   _ \        L    O    R
    D    A    R     _ / _ / |   /     /         \ \   | \ _ \ _        K    L    O
   D    D           _ / _ / |   /     /          \ \   | \ _ \ _             A
       K        _ / _ /     | /     /     _       \ \ |     \ _ \ _      L    O    R
 D    A        _ / _ /      | /     /     _       \ \ |      \ _ \ _      R         K
            _ / _ /         | |     |   |   \ (O) / | |         \ _ \ _         O
    D      _ / _ /          | |     |   |    \   /  | |          \ _ \ _         D
   A      / _ /     |   |   | \     |   \ _   \|/   / |   |   |     \ _ \
  K      / _ /      |   |   | \     |   \ _    V    / |   |   |      \ _ \         L
        / /         |   |   |   \ _ /       \ _ _ /   |   |   |         \ \
       / /          |   |   |                         |   | | |          \ \
      / /       |   | | \     \       ROWECHEN      /     / | |   |       \ \
     / /    _ _ |   | | \     \        ZHONG        /     / | |   | _ _    \ \
    / / _ /   \ | | | |   \ / \ \                 / / \ /   | | | | /   \ _ \ \
   / / _ /    \ | | | |       \ \                 / /       | | | | /    \ _ \ \
  / / /         \ \ \ \ /       /                 \       \ / / / /         \ \ \
 \ / /          \ \ \ \ /       /                 \       \ / / / /          \ \ /
  \|/             \|/         |         |         |           \|/             \|/
  L         O     \|/         |         |   |     |           \|/        R    D
 A    R    K    L             / _ |     |   | _     \      O    R    D    D    A    R
     L    O         R         / _ |     |   | _     \       D    D         A    R
    L    O    R    D        / / / _     | _ | | \ _   \      D    A    R         K
   O    R    D              / / / _ |   | _ | | \ _   \       D    A    R    K    L
  R    D    D    A    R     | / / | | / | | \ / | | \ |        K    L    O    R    D
 A         R         K      | / / | | / | | \ / | | \ |              L    O         R
     D    A         R         /   \ / | | | / | | / \ /     K    L         O    R
         D    D         A     /   \ / | | | / | | / \/            R    K    L    O
             R         D    D     / | / \ |   \ /        A    R    K    L    O    R
       D    A    R    K    L      / | / \ |    \/              O    R    D    D
 R    K    L    O    R    D       \ /     |      D    A    R         K    L    O    R
          D    A    R             \/      |            K    L    O    R    D    D

*/
//TEMPLATE V2
	import java.io.*;
	import java.util.*;
	import java.math.*;

    public class C463 {
    //Solution goes below: ------------------------------------
    public static void solution() throws IOException{
        int n = nextInt();
        int[][] a = new int[n][n];
        long[] UR = new long[2*n-1]; // 0 through 2n-2. i+j.
        long[] UL = new long[2*n-1]; // -n+1 through n-1; i-j+n-1.
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                a[i][j] = nextInt();
                UR[i+j]+=a[i][j];
                UL[i-j+n-1]+=a[i][j];
            }
        }
        long[] pmax = new long[]{-1,-1};
        int[][] res = new int[2][2];
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                long sc = UR[i+j]+UL[i-j+n-1]-a[i][j];
                int par = (i+j)%2;
                if(pmax[par]<sc){
                    pmax[par] = sc;
                    res[par] = new int[]{i+1,j+1};
                }
            }
        }
        println(pmax[0]+pmax[1]);
        println(String.format("%d %d %d %d",res[0][0],res[0][1],res[1][0],res[1][1]));
    }

    //Solution goes above: ------------------------------------
    public static final String IN_FILE = "";
    public static final String OUT_FILE = "";
    //-------------------- ------------------------------------
    //IO
    public static BufferedReader br;
    public static StringTokenizer st;
    public static BufferedWriter bw;
    public static void main(String[] args) throws IOException{
        if(IN_FILE==""){
            br = new BufferedReader(new InputStreamReader(System.in));
        }else{
            try {
                br = new BufferedReader(new FileReader(IN_FILE));
            } catch (FileNotFoundException e) {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
        }
        if (OUT_FILE==""){
            bw = new BufferedWriter(new OutputStreamWriter(System.out));
        }else{
            try {
                bw = new BufferedWriter (new FileWriter(OUT_FILE) );
            } catch (FileNotFoundException e) {
                bw = new BufferedWriter(new OutputStreamWriter(System.out));
            }
        }
        solution();
        bw.close();//Flushes too.
    }

    public static String nextToken() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    public static String nextLine() {
        st = null;
        try {
            return br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

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

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

    public static double nextDouble() {
        return Double.parseDouble(nextToken());
    }

    public static void println(Object s) throws IOException{
        bw.write(s.toString()+"\n");
    }

    public static void println() throws IOException{
        bw.newLine();
    }

    public static void print(Object s) throws IOException{
        bw.write(s.toString());
    }
    public static void flush() throws IOException{//Useful for debug
        bw.flush();
    }
    //Other
    public static class Arr<T> extends ArrayList<T> {} //I hate typing ArrayList
}