#include <bits/stdc++.h>
using namespace std;
const double INF = 1e-9;
const int EPS = 1e9 + 7;
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<vector<long long> > a(n, vector<long long>(n));
  vector<long long> b(n * 2), c(n * 2);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      b[i - j + n] += a[i][j];
      c[i + j] += a[i][j];
    }
  }
  int i1 = 0, j1 = 0, i2 = 1, j2 = 0;
  long long sum0 = b[n] + c[0] - a[0][0], sum1 = b[n + 1] + c[1] - a[1][0];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if ((i + j) % 2) {
        if (sum0 < b[i - j + n] + c[i + j] - a[i][j]) {
          sum0 = b[i - j + n] + c[i + j] - a[i][j];
          i1 = i;
          j1 = j;
        }
      } else {
        if (sum1 < b[i - j + n] + c[i + j] - a[i][j]) {
          sum1 = b[i - j + n] + c[i + j] - a[i][j];
          i2 = i;
          j2 = j;
        }
      }
    }
  }
  cout << sum0 + sum1 << endl
       << i1 + 1 << " " << j1 + 1 << " " << i2 + 1 << " " << j2 + 1;
  return 0;
}
