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 LL_INF = 1LL << 60;
vector<int> isPrime((long long)1e5 + 1, true);
void findPrime(long long n) {
  for (int i = 2; i * i <= n; i++) {
    if (isPrime[i]) {
      for (int j = i * i; j <= n; j += i) isPrime[j] = false;
    }
  }
  return;
}
set<long long> prime_square;
void precompute_prime_squares() {
  vector<int> is_prime(1000000 + 1, true);
  for (int i = 2; i <= 1e6; i++) {
    if (is_prime[i]) {
      prime_square.insert(i * 1LL * i);
      for (int multiple = 2 * i; multiple <= 1e6; multiple += i)
        is_prime[multiple] = false;
    }
  }
}
void printV(vector<long long> &v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
  return;
}
void inputV(vector<long long> &v) {
  for (int i = 0; i < v.size(); i++) {
    cin >> v[i];
  }
}
bool isPrimeINT(int n) {
  if (n <= 1) return false;
  if (n == 2) {
    return true;
  }
  for (int i = 3; i < n / 2 + 1; i = i + 2)
    if (n % i == 0) return false;
  return true;
}
int interact(int i, int j) {
  cout << "? " << i + 1 << " " << j + 1 << "\n";
  int x;
  cin >> x;
  return x;
}
vector<int> factors(int n) {
  vector<int> v;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      if (i != n / i) v.push_back(n / i);
    }
  }
  return v;
}
vector<long long> fact(1e6, 1);
void factorial(long long n) {
  for (long long i = 1; i <= n; i++) {
    fact[i] =
        (fact[i - 1] % (long long)1000000007 * i % (long long)1000000007) %
        (long long)1000000007;
  }
}
void check() { cout << "Check\n"; }
void test_case() {
  long long n, m, k = 0, i, j, res = 0, q = 0;
  cin >> n;
  vector<vector<long long>> board(n, vector<long long>(n));
  vector<long long> rightD(2 * n - 1, 0), leftD(2 * n - 1, 0);
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> board[i][j];
      rightD[i + j] += board[i][j];
      leftD[n - 1 - (j - i)] += board[i][j];
    }
  }
  long long white = 0, black = 0;
  long long wi = 0, bi = 0, wj = 0, bj = 1;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if ((i + j) % 2 == 0) {
        if (rightD[i + j] + leftD[n - 1 - (j - i)] - board[i][j] > white) {
          white = rightD[i + j] + leftD[n - 1 - (j - i)] - board[i][j];
          wi = i;
          wj = j;
        }
      } else {
        if (rightD[i + j] + leftD[n - 1 - (j - i)] - board[i][j] > black) {
          black = rightD[i + j] + leftD[n - 1 - (j - i)] - board[i][j];
          bi = i;
          bj = j;
        }
      }
    }
  }
  cout << white + black << "\n";
  printf("%lld %lld %lld %lld", wi + 1, wj + 1, bi + 1, bj + 1);
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long TT = 1;
  for (long long i = 0; i < TT; i++) {
    test_case();
  }
  return 0;
}
