#include <bits/stdc++.h>
using namespace std;
long long int b[4001], c[4001], a[2000][2000], mmax[2], t;
int main(int argc, char **argv) {
  for (int i = 0; i < 4001; i++) b[i] = c[i] = 0;
  int n, mx[2], my[2], tch;
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      scanf("%I64d", &a[i][j]);
      b[i - j + 2000] += a[i][j];
      c[i + j] += a[i][j];
    }
  mmax[0] = mmax[1] = -1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      t = b[i - j + 2000] + c[i + j] - a[i][j];
      tch = (i + j) % 2;
      if (mmax[tch] < t) {
        mmax[tch] = t;
        mx[tch] = i + 1;
        my[tch] = j + 1;
      }
    }
  printf("%I64d\n%d %d %d %d", mmax[1] + mmax[0], mx[0], my[0], mx[1], my[1]);
  return 0;
}
