#include <bits/stdc++.h>
using namespace std;
long long board[2001][2001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, j, n, a, x;
  long long max0 = -5, max1 = -5, x1, y1, x2, y2;
  cin >> n;
  long long sum[5005] = {0}, rsum[5005] = {0};
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      cin >> board[i][j];
      sum[i + j] += board[i][j];
      rsum[j + n - i + 1] += board[i][j];
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if ((i + j) % 2 == 0) {
        if (sum[i + j] + rsum[n - i + j + 1] - board[i][j] > max0) {
          max0 = sum[i + j] + rsum[n - i + j + 1] - board[i][j];
          x1 = i;
          y1 = j;
        }
      } else {
        if (sum[i + j] + rsum[n - i + j + 1] - board[i][j] > max1) {
          max1 = sum[i + j] + rsum[n - i + j + 1] - board[i][j];
          x2 = i;
          y2 = j;
        }
      }
    }
  }
  cout << max1 + max0 << endl;
  cout << x1 << " " << y1 << " " << x2 << " " << y2 << endl;
  return 0;
}
