#include <bits/stdc++.h>
long long unsigned A[2222][2222], B[2222][2222];
int main() {
  unsigned n, i, j, k, x = 1, y = 1, X = 1, Y = 2;
  long long unsigned l = 0, r = 0, s;
  scanf("%u", &n);
  for (i = 0; i++ < n;)
    for (j = 0; j++ < n;) {
      scanf("%I64u", &s);
      A[i][j] = s + A[i - 1][j - 1];
      B[i][j] = s + B[i - 1][j + 1];
    }
  for (i = 0; i++ < n;)
    for (j = 0; j++ < n;) {
      s = A[i - 1][j - 1] - A[i][j];
      k = n - i;
      if (k > n - j) k = n - j;
      s += A[i + k][j + k];
      k = n - i;
      if (k > j - 1) k = j - 1;
      s += B[i + k][j - k];
      if ((i ^ j) & 1) {
        if (l < s) {
          X = i;
          Y = j;
          l = s;
        }
      } else if (r < s) {
        x = i;
        y = j;
        r = s;
      }
    }
  printf("%I64u\n", l + r);
  printf("%u %u %u %u\n", x, y, X, Y);
  return 0;
}
