#include <bits/stdc++.h>
using namespace std;
inline int sn() {
  int n = 0;
  int ch = getchar();
  while (ch < 48) ch = getchar();
  while (ch > 47) n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  return n;
}
int curx, cury, n;
int x[2005][2005];
int valid() {
  if (1 <= curx && curx <= n && 1 <= cury && cury <= n)
    return 1;
  else
    return 0;
}
int main() {
  int i, j;
  long long it;
  n = sn();
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) x[i][j] = sn();
  map<int, long long> a;
  map<int, long long> b;
  map<int, long long> c;
  map<int, long long> d;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if ((i + j) % 2 == 0) {
        a[i + j] += x[i][j];
        b[i - j] += x[i][j];
      } else {
        c[i + j] += x[i][j];
        d[i - j] += x[i][j];
      }
    }
  }
  long long max1 = 0, max2 = 0;
  int k1 = 1, k2 = 1, k3 = 1, k4 = 2;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if ((i + j) % 2 == 0) {
        if (max1 < a[i + j] + b[i - j] - x[i][j]) {
          max1 = a[i + j] + b[i - j] - x[i][j];
          k1 = i;
          k2 = j;
        }
      } else {
        if (max2 < c[i + j] + d[i - j] - x[i][j]) {
          max2 = c[i + j] + d[i - j] - x[i][j];
          k3 = i;
          k4 = j;
        }
      }
    }
  }
  printf("%lld", max1 + max2);
  printf("\n");
  printf("%d %d %d %d\n", k1, k2, k3, k4);
  return 0;
}
