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.io.IOException;
import java.lang.Thread.State;
import java.util.*;
//import javafx.util.Pair; 
//import java.util.concurrent.LinkedBlockingDeque;




    
  public class Codeforces {
        
        public static long mod = (long)Math.pow(10, 9)+7 ;
        public static double epsilon=0.00000000008854;//value of epsilon
        public static InputReader sc = new InputReader(System.in);
        public static PrintWriter pw = new PrintWriter(System.out);
        
        public static ArrayList<ArrayList <Integer>> GetGraph(int n,int m){
            ArrayList<ArrayList <Integer>> g=new ArrayList<>();
            for(int i=0;i<n;i++){
                g.add(new ArrayList<>());
            }
            for(int i=0;i<m;i++){
                //int t=sc.nextInt();
                int u=sc.nextInt()-1;
                int v=sc.nextInt()-1;
                g.get(u).add(v);
                //if(t==0)
                g.get(v).add(u);
            }
            return g;
        }
        
        public static int find(int a,int p[]){
            if(a!=p[a]){
               p[a]=find(p[a], p);
            }
             return p[a];
        }
        public static void Union(int a,int b,int p[]){
            p[find(b, p)]=find(a, p);
        }
        public static long gcd(long a,long b){
            while(b>0){
                long t=b;
                b=a%b;
                a=t;
            }
            return a;
        }
        public static int dfs(ArrayList<ArrayList <Integer>> g,int u,int vis[],int p[],int down[]){
            vis[u]=1;
            int c=p[u];
            for(int i=0;i<g.get(u).size();i++){
                int v=g.get(u).get(i);
                if(vis[v]==0){
                    c+=dfs(g, v, vis, p, down);
                }
            }
            down[u]=c;
            return c;
        }
        public static boolean dfs1(ArrayList<ArrayList <Integer>> g,int u,int vis[],int bad[],int good[],int p[]){
            
            boolean ans=true;
            int g1=0,b1=0;
            vis[u]=1;
            for(int i=0;i<g.get(u).size();i++){
                int v=g.get(u).get(i);
                if(vis[v]==0){
                    g1+=good[v];
                    b1+=bad[v];
                    if(!dfs1(g, v, vis, bad, good,p)){
                        return false;
                    }
                }
            }
            if(g1>good[u]||(g1+b1+p[u])!=(good[u]+bad[u])){
                
                return false;
            }
            return true;
        }
        public static void sieve(int n,ArrayList<Integer> p){
            int a[]=new int[n+1];
            Arrays.fill(a, 1);
            for(int i=2;i<=Math.sqrt(n);i++){
                if(a[i]==1)
                for(int j=i*i;j<=n;j+=i){
                    a[j]=0;
                }
            }
            for(int i=2;i<=n;i++){
                if(a[i]==1){
                    p.add(i);
                }
            }
            
        }
        public static void main(String[] args) {
            // code starts..
            int n=sc.nextInt();
            int a[][]=new int[n][n];
            for(int i=0;i<n;i++){
                a[i]=scanArray(n);
            }
            long sum[]=new long[2*n];
            long dif[]=new long[2*n];
            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){
                    sum[i+j]+=a[i][j];
                    //sum[i+j][1]=(long)(i+j);
                    dif[i-j+n]+=a[i][j];
                    //dif[i-j+n][1]=(long)(i-j+n);
                }
            }
            long sum1=Long.MIN_VALUE;int y1=0,x1=0;
            long sum2=Long.MIN_VALUE;int y2=0,x2=0;
            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){
                    long temp=sum[i+j]+dif[i-j+n]-a[i][j];
                    if((i+j)%2==0){
                        if(sum1<temp){
                            sum1=temp;
                            x1=i+1;
                            y1=j+1;
                        }
                    }
                    else{
                        if(sum2<temp){
                            sum2=temp;
                            x2=i+1;
                            y2=j+1;
                        }
                    }
                }
            }
            pw.println(sum1+sum2);
            pw.println(x1+" "+y1+" "+x2+" "+y2);
            // Code ends...
            pw.flush();
            pw.close();
        }
       
        public static Comparator<Long[]> column(int i){
            return 
            new Comparator<Long[]>() {
                @Override
                public int compare(Long[] o1, Long[] o2) {
                    return o1[i].compareTo(o2[i]);//for ascending
                    //return o2[i].compareTo(o1[i]);//for descending
                }
            };
        }
        public static Comparator<Pair> C(){
            return 
            new Comparator<Pair>() {
                @Override
                public int compare(Pair o1, Pair o2) {
                    return o2.le-o1.le;//for des
                }
            };
        }
        
        public static Comparator<Integer[]> pair(){
            return 
            new Comparator<Integer[]>() {
                @Override
                public int compare(Integer[] o1, Integer[] o2) {
                    int result=o1[0].compareTo(o2[0]);
                    if(result==0)
                    result=o1[1].compareTo(o2[1]);
                    return result;
                }
            };
        }
        
        public static String reverseString(String s){
            StringBuilder input1 = new StringBuilder(); 
            input1.append(s);  
            input1 = input1.reverse();
            return input1.toString();
        }
        public static int[] scanArray(int n){
            int a[]=new int [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextInt();
    
            return a;
        }
        public static long[] scanLongArray(int n){
            long a[]=new long [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextLong();
    
            return a;
        }
        public static String [] scanStrings(int n){
            String a[]=new String [n];
            for(int i=0;i<n;i++)
            a[i]=sc.nextLine();
    
            return a;
        }
        
    }
    
    class InputReader {
    
            private final InputStream stream;
            private final byte[] buf = new byte[8192];
            private int curChar, snumChars;
            private SpaceCharFilter filter;
    
            public InputReader(InputStream stream) {
                this.stream = stream;
            }
    
            public int snext() {
                if (snumChars == -1)
                    throw new InputMismatchException();
                if (curChar >= snumChars) {
                    curChar = 0;
                    try {
                        snumChars = stream.read(buf);
                    } catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if (snumChars <= 0)
                        return -1;
                }
                return buf[curChar++];
            }
    
            public int nextInt() {
                int c = snext();
                while (isSpaceChar(c)) {
                    c = snext();
                }
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = snext();
                }
                int res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
            }
    
            public long nextLong() {
                int c = snext();
                while (isSpaceChar(c)) {
                    c = snext();
                }
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = snext();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
            }
    
            public int[] nextIntArray(int n) {
                int a[] = new int[n];
                for (int i = 0; i < n; i++) {
                    a[i] = nextInt();
                }
                return a;
            }
    
            public String readString() {
                int c = snext();
                while (isSpaceChar(c)) {
                    c = snext();
                }
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
            }
    
            public String nextLine() {
                int c = snext();
                while (isSpaceChar(c))
                    c = snext();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = snext();
                } while (!isEndOfLine(c));
                return res.toString();
            }
    
            public boolean isSpaceChar(int c) {
                if (filter != null)
                    return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            }
    
            private boolean isEndOfLine(int c) {
                return c == '\n' || c == '\r' || c == -1;
            }
    
            public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            }
        }
        class Pair{
            int le;
            int p;
            Pair(int leaves,int parent){
                le=leaves;
                p=parent;
            }
        }
        
        
        