#include <bits/stdc++.h>
using namespace std;
ifstream fin("input");
void init() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
}
const int mx = 2001;
int n;
long long g[mx][mx], upleft[mx][mx], upright[mx][mx], downleft[mx][mx],
    downright[mx][mx];
void read() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int k = 1; k <= n; k++) {
      cin >> g[i][k];
    }
  }
}
void solve() {
  for (int i = 1; i <= n; i++) {
    for (int k = 1; k <= n; k++) {
      upleft[i][k] = g[i][k] + upleft[i - 1][k - 1];
      upright[i][k] = g[i][k] + upright[i - 1][k + 1];
    }
  }
  for (int i = n; i >= 1; i--) {
    for (int k = 1; k <= n; k++) {
      downleft[i][k] = g[i][k] + downleft[i + 1][k - 1];
      downright[i][k] = g[i][k] + downright[i + 1][k + 1];
    }
  }
  long long white = -1, black = -1;
  int x1, y1, x2, y2;
  for (int i = 1; i <= n; i++) {
    for (int k = 1; k <= n; k++) {
      long long total = downleft[i][k] + downright[i][k] + upleft[i][k] +
                        upright[i][k] - 3 * g[i][k];
      if ((i + k) % 2 == 0) {
        if (total > white) {
          white = total;
          x1 = i;
          y1 = k;
        }
      } else {
        if (total > black) {
          black = total;
          x2 = i;
          y2 = k;
        }
      }
    }
  }
  cout << white + black << endl;
  cout << x1 << " " << y1 << " " << x2 << " " << y2 << endl;
}
int main() {
  init();
  read();
  solve();
  return 0;
}
