#include <bits/stdc++.h>
template <typename T>
T power(T x, T y, T mod) {
  T res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y /= 2;
    x = (x * x) % mod;
  }
  return res;
}
using namespace std;
long long int a[2005][2005];
long long int d1[4005];
long long int d2[4005];
long long int ele[2005][2005];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  for (long long int i = 0; i < n; i++)
    for (long long int j = 0; j < n; j++) cin >> a[i][j];
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < n; j++) {
      long long int b = a[i][j];
      d1[j - i + n] += b;
      d2[n + n - i - j - 1] += b;
    }
  }
  long long int max1 = 0;
  long long int max2 = 0;
  long long int x1, y1, x2, y2;
  x1 = 1;
  x2 = 1;
  y1 = 1;
  y2 = 2;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < n; j++) {
      ele[i][j] = d1[j - i + n] + d2[2 * n - i - j - 1] - a[i][j];
      if ((i + j) % 2) {
        if (max1 < ele[i][j]) {
          max1 = ele[i][j];
          x1 = i + 1;
          y1 = j + 1;
        }
      } else {
        if (max2 < ele[i][j]) {
          max2 = ele[i][j];
          x2 = i + 1;
          y2 = j + 1;
        }
      }
    }
  }
  cout << max1 + max2 << '\n';
  cout << x1 << " " << y1 << " " << x2 << " " << y2 << '\n';
}
