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 os
import sys
from io import BytesIO, IOBase
 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
#######################################

a=int(input())
ans=[]
for i in range(a):
    z=list(map(int,input().split()))
    ans.append(z)

pri1=pow(10,9)+7

from collections import *

obt=defaultdict(int)
act=defaultdict(int)
for i in range(a):
    for j in range(a):
        p,q=i,j
        p,q=p-min(p,q),q-min(p,q)
        obt[p-q]+=ans[i][j]
  
        p,q=i,j
        act[p+q]+=ans[i][j]
        
maxa1=0
maxa2=0
p1=0
p2=0
p3=0
p4=0
for i in range(a):
    for j in range(a):
        if(i%2==j%2):
            if(min(i,j)==0 or min(i,j)==a-1):
                value=ans[i][j]
            else:
                p,q=i,j
                p,q=p-min(p,q),q-min(p,q)
                value=0
                value+=obt[p-q]
                value+=act[i+j]
                value-=ans[i][j]
                
            maxa1=max(maxa1,value)
            if(maxa1==value):
                p1,p2=i,j
                
            
        else:
            if(min(i,j)==0 or min(i,j)==a-1):
                value=ans[i][j]
            else:
                p,q=i,j
                value=0
                p,q=p-min(p,q),q-min(p,q)
                value+=obt[p-q]
                value+=act[i+j]
                value-=ans[i][j]
            maxa2=max(maxa2,value)
            if(maxa2==value):
                p3,p4=i,j
print(maxa1+maxa2)
print(p1+1,p2+1,p3+1,p4+1)
            

        
