#include <bits/stdc++.h>
using namespace std;
long long int sum[4010];
long long int dif[4010];
long long int ch[2010][2010];
int main() {
  int n;
  cin >> n;
  n++;
  for (int i = (1); i < (n); i++) {
    for (int j = (1); j < (n); j++) {
      scanf("%d", &ch[i][j]);
      sum[i + j] += ch[i][j];
      dif[i - j + n - 1] += ch[i][j];
    }
  }
  long long int sol[2] = {-1, -1};
  int x[2] = {-1, -1};
  int y[2] = {-1, -1};
  for (int i = (1); i < (n); i++) {
    for (int j = (1); j < (n); j++) {
      long long int cand = sum[i + j] + dif[i - j + n - 1] - ch[i][j];
      if (cand > sol[(i + j) & 1]) {
        sol[(i + j) & 1] = cand;
        x[(i + j) & 1] = i;
        y[(i + j) & 1] = j;
      }
    }
  }
  cout << (sol[0] + sol[1]) << endl;
  cout << x[0] << " " << y[0] << " " << x[1] << " " << y[1] << endl;
  return 0;
}
