#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n;
  cin >> n;
  long long a[n][n];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) cin >> a[i][j];
  }
  long long pre[n][n], sec[n][n];
  for (long long i = 0; i < n; i++) {
    pre[i][0] = a[i][0];
    pre[0][i] = a[0][i];
    sec[0][i] = a[0][i];
  }
  for (long long i = 1; i < n; i++) {
    for (long long j = 1; j < n; j++) {
      pre[i][j] = pre[i - 1][j - 1] + a[i][j];
    }
  }
  for (long long i = n - 2; i >= 0; i--) {
    for (long long j = n - 2; j >= 0; j--) {
      pre[i][j] = pre[i + 1][j + 1];
    }
  }
  for (long long i = 0; i < n; i++) sec[i][n - 1] = a[i][n - 1];
  for (long long i = 1; i < n; i++) {
    for (long long j = n - 2; j >= 0; j--) {
      sec[i][j] = sec[i - 1][j + 1] + a[i][j];
    }
  }
  for (long long i = n - 2; i >= 0; i--) {
    for (long long j = 1; j < n; j++) {
      sec[i][j] = sec[i + 1][j - 1];
    }
  }
  long long p = INT_MIN, q = INT_MIN, x1 = 0, y1 = 0, x2 = 0, y2 = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if ((i + j) % 2 == 1) {
        long long res = pre[i][j] + sec[i][j] - a[i][j];
        if (p < res) {
          p = res;
          x1 = i + 1;
          y1 = j + 1;
        }
      } else {
        long long res = pre[i][j] + sec[i][j] - a[i][j];
        if (q < res) {
          q = res;
          x2 = i + 1;
          y2 = j + 1;
        }
      }
    }
  }
  cout << p + q << "\n";
  cout << x1 << " " << y1 << " " << x2 << " " << y2 << "\n";
}
