#include <bits/stdc++.h>
using namespace std;
unsigned long long a[2002][2002], d1[4003], d2[4003], i, j, k, n;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  memset(d1, 0, sizeof(d1));
  memset(d2, 0, sizeof(d2));
  unsigned long long m = 0, x, y, x1, y1, m2 = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      cin >> a[i][j];
      d2[i + j] += a[i][j];
      if (i >= j) {
        d1[i - j] += a[i][j];
      } else {
        d1[2 * n - 1 + i - j] += a[i][j];
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (i >= j) {
        a[i][j] = d2[i + j] + d1[i - j] - a[i][j];
      } else {
        a[i][j] = d2[i + j] + d1[2 * n - 1 + i - j] - a[i][j];
      }
    }
  }
  m = m2 = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if ((i + j) % 2 == 0) {
        if (m != max(m, a[i][j])) {
          m = max(m, a[i][j]);
          x = i;
          y = j;
        }
      } else if (m2 != max(m2, a[i][j])) {
        m2 = max(m2, a[i][j]);
        x1 = (unsigned long long)i;
        y1 = (unsigned long long)j;
      }
    }
  }
  if (m + m2 == 0) {
    cout << "0" << endl;
    cout << "1"
         << " "
         << "1"
         << " "
         << "2"
         << " "
         << "1";
  } else {
    cout << m + m2 << endl;
    cout << x << " " << y << " " << x1 << " " << y1 << endl;
  }
  return 0;
}
