#include <bits/stdc++.h>
using namespace std;
const int N = 2003;
long long n, a[N][N], dp[2 * N], dp1[2 * N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      dp[i + j] += a[i][j];
      dp1[i - j + n] += a[i][j];
    }
  }
  long long y = -1, x = -1;
  pair<long long, long long> p, pp;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      long long k = dp[i + j] + dp1[i - j + n] - a[i][j];
      if ((i + j) & 1) {
        if (k > y) {
          y = k;
          p = {i, j};
        }
      } else {
        if (k > x) {
          x = k;
          pp = {i, j};
        }
      }
    }
  }
  cout << x + y << endl
       << p.first + 1 << " " << p.second + 1 << " " << pp.first + 1 << " "
       << pp.second + 1;
}
