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
/*
 * Remember a 7.0 student can know more than a 10.0 student.
 * Grades don't determine intelligence, they test obedience. 
 * I Never Give Up.
 */
import java.util.*;
import java.util.Map.Entry;
import java.io.*;

import javax.xml.stream.events.Characters;

import sun.security.x509.IPAddressName;
import static java.lang.System.out;
import static java.util.Arrays.*;
import static java.lang.Math.*;
public class ContestMain {
	private static Reader in=new Reader();
	private static StringBuilder ans=new StringBuilder();
	private static long MOD=1000000007;//10^9+7 
	private static final int N=1000000;//10^6
	private static final int LIM=26;
//	private static final double PI=3.1415;
//	private static ArrayList<Integer> v[]=new ArrayList[N];
//	private static int color[]=new int[N]; //For Graph Coloring
//	private static boolean mark[]=new boolean[N];
//	private static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
//	private static void dfs(int node){mark[node]=true;for(int x:v[node]){if(!mark[x]){dfs(x);}}}
	private static long powmod(long x,long n,long m){
		if(n==0)return 1;
		else if(n%2==0)return(powmod((x*x)%m,n/2,m));
		else return (x*(powmod((x*x)%m,(n-1)/2,m)))%m;
	}
//	private static void shuffle(String[] arr) {
//		for (int i = arr.length - 1; i >= 2; i--) {
//			int x = new Random().nextInt(i - 1);
//	        String temp = arr[x];
//	        arr[x] = arr[i];
//	        arr[i] = temp;
//	    }
//	 }
	
	//OJ Doing = Codeforces
	//Double check the code
	public static void main(String[] args) throws IOException{
		int n=in.nextInt();
		long ar[][]=new long[n][n];
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++)
				ar[i][j]=in.nextLong();
		}
		long dr[][]=new long[n][n];
		long dl[][]=new long[n][n];
		long sum=0;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(j-1<0||i-1<0)dr[i][j]=ar[i][j];
				else dr[i][j]=dr[i-1][j-1]+ar[i][j];
			}
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(i-1<0||j+1>n-1)dl[i][j]=ar[i][j];
				else dl[i][j]=dl[i-1][j+1]+ar[i][j];
			}
		}
		int m,d;
		int x1=0,y1=0,x2=0,y2=0;
		long s1=0,s2=0;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				m=min(n-i-1,n-j-1);
				d=min(n-i-1,j);
				sum=dr[i+m][j+m]+dl[i+d][j-d]-ar[i][j];
//				out.println(i+" "+j+" "+sum);
				if((i+j)%2==0&&sum>=s1){
					s1=sum;
					x1=i+1;
					y1=j+1;
				}
				else if((i+j)%2!=0&&sum>=s2){
					s2=sum;
					x2=i+1;
					y2=j+1;
				}
			}
		}
		out.println(s1+s2);
		out.println(x1+" "+y1+" "+x2+" "+y2);
	}
	static class Pair implements Comparable<Pair>{
		long l;
		long r;
		Pair(){
			l=0;
			r=0;
		}
		Pair(long k,long v){
			l=k;
			r=v;
		}
		@Override
		public int compareTo(Pair o) {
			if(l!=o.l)return (int) (l-o.l);
			else return (int) -(r-o.r);  //changed
		}
		
	}
	static class Reader{
        BufferedReader br;
        StringTokenizer st;
        public Reader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt()
        {
            return Integer.parseInt(next());
        }
 
        long nextLong()
        {
            return Long.parseLong(next());
        }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}         