#include <bits/stdc++.h>
using namespace std;
int a[2005][2005];
long long pri[4005], sec[4005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &a[i][j]);
      pri[i - j + n] += a[i][j];
      sec[i + j] += a[i][j];
    }
  }
  long long b = 0, w = 0, val;
  int pos_b[2] = {1, 1}, pos_w[2] = {1, 2};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      val = pri[i - j + n] + sec[i + j] - a[i][j];
      if ((i + j) & 1) {
        if (val > w) w = val, pos_w[0] = i + 1, pos_w[1] = j + 1;
      } else {
        if (val > b) b = val, pos_b[0] = i + 1, pos_b[1] = j + 1;
      }
    }
  }
  cout << b + w << endl;
  cout << pos_b[0] << " " << pos_b[1] << " ";
  cout << pos_w[0] << " " << pos_w[1] << " ";
  return 0;
}
