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
#include <bits/stdc++.h>
using namespace std;
long long a1[2001][2001], a2[2001][2001], summ;
long long a[2001][2001], n, ans1 = -1, ans2 = -1, i1, i2, jj, j2;
int t;
int main() {
  scanf("%lld", &n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) scanf("%lld", &a[i][j]);
  for (int i = 0; i < n; i++) {
    t = i;
    summ = 0;
    for (int j = 0; max(j, t) < n; j++, t++) summ += a[t][j];
    t = i;
    for (int j = 0; max(j, t) < n; j++, t++) a1[t][j] = summ;
    summ = 0;
    t = i;
    for (int j = 0; max(j, t) < n; j++, t++) summ += a[j][t];
    t = i;
    for (int j = 0; max(j, t) < n; j++, t++) a1[j][t] = summ;
  }
  for (int i = 0; i < n; i++) {
    t = i;
    summ = 0;
    for (int j = 0; j < n && t > -1; j++, t--) summ += a[t][j];
    t = i;
    for (int j = 0; j < n && t > -1; j++, t--) a2[t][j] = summ;
    summ = 0;
    t = i;
    for (int j = 0; j < n && t > -1; j++, t--) summ += a[n - j - 1][n - t - 1];
    t = i;
    for (int j = 0; j < n && t > -1; j++, t--) a2[n - j - 1][n - t - 1] = summ;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if ((i + j) % 2 == 0) {
        if (ans1 < a1[i][j] + a2[i][j] - a[i][j])
          ans1 = a1[i][j] + a2[i][j] - a[i][j], i1 = i + 1, jj = j + 1;
      } else {
        if (ans2 < a1[i][j] + a2[i][j] - a[i][j])
          ans2 = a1[i][j] + a2[i][j] - a[i][j], i2 = i + 1, j2 = j + 1;
      }
  cout << ans1 + ans2 << endl
       << i1 << " " << jj << " " << i2 << " " << j2 << endl;
}
