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
/*
 * Code Author: Jayesh Udhani
 * Dhirubhai Ambani Institute of Information and Communication Technology (DA-IICT ,Gandhinagar)
 * 2nd Year ICT BTECH student
 */
import java.io.*;
import java.util.*;
public class hashing {
	private static void show(long a[])
	{
		int n=a.length;
		System.out.println("The array is");
		for(int i=0;i<n;i++)
			System.out.print(a[i]+"  ");

	}
	public static void main(String args[])
	{
		InputReader in = new InputReader(System.in);
		OutputStream outputStream = System.out;
		PrintWriter out = new PrintWriter(outputStream);
		//----------My Code Starts Here----------
		int n=in.nextInt(),i=0,j=0;
		long[] x=new long[2*n-1];		//  To store / sums
		long[] y=new long[2*n-1];		//  To store \ sums
		Arrays.fill(x, 0);
		Arrays.fill(y, 0);
		int[][] a=new int[n][n];
		long ans=0;
		for(i=0;i<n;i++)
		{
			for(j=0;j<n;j++)
			{
				int p=i,q=j;
				a[i][j]=in.nextInt();
				x[i+j]+=(long)a[i][j];
				if(p!=0 && q!=0)
				{
					int temp=Math.min(p, q);
					p-=temp;
					q-=temp;
				}
				if(q==0)
					y[n-p-1]+=(long) a[i][j];
				else if(p==0)
					y[n-1+q]+=(long) a[i][j];
			}
		}
		long max1=Long.MIN_VALUE,max2=Long.MIN_VALUE;
		int r1=-1,s1=-1,r2=-1,s2=-1;
		for(i=0;i<n;i++)
		{
			for(j=0;j<n;j++)
			{
				int p=i,q=j;
				if(p!=0 && q!=0)
				{
					int temp=Math.min(p, q);
					p-=temp;
					q-=temp;
				}
				long sum=x[i+j]+((q==0)?y[n-p-1]:y[n-1+q])-a[i][j];
				if((i+j)%2!=0)			// Use max1 
				{
					if(sum>max1)
					{
						max1=sum;
						r1=i;
						s1=j;
					}
				}
				else					// Use max2
				{
					if(sum>max2)
					{
						max2=sum;
						r2=i;
						s2=j;
					}
				}
			}
		}
		r1++;
		r2++;
		s1++;
		s2++;
		System.out.println(max1+max2);
		System.out.println(r1+" "+s1+" "+r2+" "+s2);

		out.close();
		//---------------The End———————————————————

	}
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream inputstream) {
			reader = new BufferedReader(new InputStreamReader(inputstream));
			tokenizer = null;
		}

		public String nextLine(){
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
	}

}
