#include <bits/stdc++.h>
using namespace std;
int scan() {
  char c;
  while (c = getchar(), (c < '0' || c > '9') && (c != '-'))
    ;
  bool flag = (c == '-');
  if (flag) c = getchar();
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return flag ? -x : x;
}
const int maxn = 2345;
int a[maxn][maxn];
long long l[maxn << 1], r[maxn << 1];
int n;
int main() {
  n = scan();
  for (int i = (1); i <= (n); ++i) {
    for (int j = (1); j <= (n); ++j) {
      a[i][j] = scan();
      l[i + j] += a[i][j];
      r[i - j + n] += a[i][j];
    }
  }
  pair<int, int> x, y;
  long long t1 = -1, t2 = -1;
  long long tmp;
  for (int i = (1); i <= (n); ++i) {
    for (int j = (1); j <= (n); ++j) {
      if ((i + j) & 1) {
        tmp = l[i + j] + r[i - j + n] - a[i][j];
        if (tmp > t1) {
          t1 = tmp;
          x.first = i, x.second = j;
        }
      } else {
        tmp = l[i + j] + r[i - j + n] - a[i][j];
        if (tmp > t2) {
          t2 = tmp;
          y.first = i, y.second = j;
        }
      }
    }
  }
  cout << t1 + t2 << endl;
  cout << x.first << " " << x.second << " " << y.first << " " << y.second
       << endl;
  return 0;
}
