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.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int n = sc.nextInt();
		long mat[][] = new long[n][n];
		long copy[][] = new long[n][n];
		for(int i = 0; i < n; ++i) {
			for(int j = 0; j < n; ++j)
				mat[i][j] = copy[i][j] = sc.nextLong();
		}
		
		for(int i = 0; i < n; ++i) {
			long sum = 0;
			for(int a = 0, b = i; b < n; ++a, ++b)
				sum += mat[a][b];
			for(int a = 0, b = i; b < n; ++a, ++b)
				mat[a][b] = sum;
		}
		
		for(int i = 1; i < n; ++i) {
			long sum = 0;
			for(int a = i, b = 0; a < n; ++a, ++b)
				sum += mat[a][b];
			for(int a = i, b = 0; a < n; ++a, ++b)
				mat[a][b] = sum;
		}
		
		for(int i = n - 1; i >= 0; --i) {
			long sum = 0;
			for(int a = 0, b = i; b >= 0; a++, b--)
				sum += copy[a][b];
			for(int a = 0, b = i; b >= 0; a++, b--)
				mat[a][b] += (sum - copy[a][b]);
		}
		
		for(int i = 1; i < n; ++i) {
			long sum = 0;
			for(int a = i, b = n - 1; a < n; a++, b--)
				sum += copy[a][b];
			for(int a = i, b = n - 1; a < n; a++, b--)
				mat[a][b] += (sum - copy[a][b]);
		}
		
		long max[] = {0, 0};
		int idx[] = {-1, -1};
		int idy[] = {-1, -1};
		int c = 0;
		
		for(int i = 0; i < n; ++i) {
			for(int j = 0; j < n; ++j) {
				c = i + j;
				if(max[(c & 1)] <= mat[i][j]) {
					max[(c & 1)] = mat[i][j];
					idx[(c & 1)] = i + 1;
					idy[(c & 1)] = j + 1;
				}
			}
		}
		
		out.println(max[0] + max[1]);
		out.println(idx[0] + " " + idy[0] + " " + idx[1] + " " + idy[1]);
		
		out.flush();
		out.close();
	}

	static class Scanner{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		public String next() throws IOException 
		{
			while (st == null || !st.hasMoreTokens()) 
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}
	}
}