#include <bits/stdc++.h>
using namespace std;
long long dp[4][2005][2005], ans[2], x[2], y[2];
long long a[2005][2005] = {0};
int main() {
  long long n, i, j, l, m, k, b, s, sum, r, m1, m2, m2x, m2y, m1i, m1j, s1, d1,
      s2, d2;
  cin >> n;
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= n; ++j) {
      scanf("%I64d", &a[i][j]);
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      dp[0][i][j] = dp[0][i - 1][j - 1] + a[i - 1][j - 1];
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = n; j >= 1; j--) {
      dp[1][i][j] = dp[1][i - 1][j + 1] + a[i - 1][j + 1];
    }
  }
  for (i = n; i >= 1; i--) {
    for (j = 1; j <= n; j++) {
      dp[2][i][j] = dp[2][i + 1][j - 1] + a[i + 1][j - 1];
    }
  }
  for (i = n; i >= 1; i--) {
    for (j = n; j >= 1; j--) {
      dp[3][i][j] = dp[3][i + 1][j + 1] + a[i + 1][j + 1];
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      k = a[i][j];
      k += dp[0][i][j];
      k += dp[1][i][j];
      k += dp[2][i][j];
      k += dp[3][i][j];
      if (k >= ans[(i + j) & 1]) {
        ans[(i + j) & 1] = k;
        x[(i + j) & 1] = i;
        y[(i + j) & 1] = j;
      }
    }
  }
  cout << ans[0] + ans[1] << endl;
  cout << x[0] << " " << y[0] << " " << x[1] << " " << y[1] << endl;
  return 0;
  ;
}
