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.*;
import java.util.*;


public class Main {

	static class PairComparator implements Comparator<Pair> {
		@Override
		public int compare(Pair x, Pair y) {
			if (x.val < y.val)
				return -1;
			if (x.val > y.val)
				return 1;
			if (x.val == y.val) {
				if (x.ind < y.ind)
					return -1;
				if (x.ind > y.ind)
					return 1;
			}
			return 0;
		}
	}

	static class Pair {
		int ind, val;

		Pair(int i, int v) {
			ind = i;
			val = v;
		}
	}

	static void func() throws Exception {
		int n = sc.nextInt();
		int[][] board = new int[n][n];
		for (int i=0;i<n;i++)board[i]=sc.intArr(n);
		//downright
		long[][] sumDR = new long[n][n];
		long[][] sumDL = new long[n][n];
		for (int i=0;i<n;i++){
			long s = 0;
			for (int j=0,k=i;j<n && k<n;j++,k++){
				s+=board[j][k];
			}
			for (int j=0,k=i;j<n && k<n;j++,k++){
				sumDR[j][k] = s;
			}
			s=0;
			
			for (int j=0,k=i;j<n && k>=0;j++,k--){
				s+=board[j][k];
			}
			for (int j=0,k=i;j<n && k>=0;j++,k--){
				sumDL[j][k] = s;
			}

			s=0;

			for (int j=i,k=0;j<n && k<n;j++,k++){
				s+=board[j][k];
			}
			for (int j=i,k=0;j<n && k<n;j++,k++){
				sumDR[j][k] = s;
			}
			s=0;
			
			for (int j=i,k=n-1;j<n && k>=0;j++,k--){
				s+=board[j][k];
			}
			for (int j=i,k=n-1;j<n && k>=0;j++,k--){
				sumDL[j][k] = s;
			}

			
		}
		long maxO = 0;
		int x1=1, y1=1,x2=1,y2=2;
		long maxE = 0;

		for (int i=0;i<n;i++){
			for (int j=0;j<n;j++){
				if ((i+j)%2==0)continue;
				long s = sumDL[i][j] + sumDR[i][j];
				s-=board[i][j];
				if (s>maxO){
					maxO=s;
					x1=i+1;
					y1=j+1;
				}
			}

		}
		for (int i=0;i<n;i++){
			for (int j=0;j<n;j++){
				if ((i+j)%2!=0)continue;
				long s = sumDL[i][j] + sumDR[i][j];
				s-=board[i][j];
				if (s>maxE){
					maxE=s;
					x2=i+1;
					y2=j+1;
				}
			}
		}
		pw.println(maxE+maxO);
		pw.println(x1 + " " + y1 + " " + x2 + " " + y2);
	}

	/*
	 
	 * */
	static PrintWriter pw;
	static MScanner sc;

	public static void main(String[] args) throws Exception {

		pw = new PrintWriter(System.out);
		sc = new MScanner(System.in);

		int tests = 1;
//		tests =sc.nextInt(); //comment this line
		while (tests-- > 0) {
			func();
			pw.flush();
		}

	}

	static class MScanner {
		StringTokenizer st;
		BufferedReader br;

		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

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

		public int[] intArr(int n) throws IOException {
			int[] in = new int[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			return in;
		}

		public long[] longArr(int n) throws IOException {
			long[] in = new long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			return in;
		}

		public int[] intSortedArr(int n) throws IOException {
			int[] in = new int[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			shuffle(in);
			Arrays.sort(in);
			return in;
		}

		public long[] longSortedArr(int n) throws IOException {
			long[] in = new long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			shuffle(in);
			Arrays.sort(in);
			return in;
		}

		public Integer[] IntegerArr(int n) throws IOException {
			Integer[] in = new Integer[n];
			for (int i = 0; i < n; i++)
				in[i] = nextInt();
			return in;
		}

		public Long[] LongArr(int n) throws IOException {
			Long[] in = new Long[n];
			for (int i = 0; i < n; i++)
				in[i] = nextLong();
			return in;
		}

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

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

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

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

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}

	static void shuffle(int[] in) {
		for (int i = 0; i < in.length; i++) {
			int idx = (int) (Math.random() * (i + 1));
			int tmp = in[i];
			in[i] = in[idx];
			in[idx] = tmp;
		}
	}

	static void shuffle(long[] in) {
		for (int i = 0; i < in.length; i++) {
			int idx = (int) (Math.random() * (i + 1));
			long tmp = in[i];
			in[i] = in[idx];
			in[idx] = tmp;
		}
	}
}
