#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<vector<long long int> > a(n, vector<long long int>(n));
  vector<long long> right(2 * n, 0);
  vector<long long> left(2 * n, 0);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      right[i - j + n] += a[i][j];
      left[i + j] += a[i][j];
    }
  long long wm = 0, bm = 0;
  int wmx = 1, wmy = 1, bmx = 1, bmy = 2;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      a[i][j] = right[i - j + n] - a[i][j] + left[i + j];
      if ((i + j) % 2 == 0) {
        if (a[i][j] > wm) {
          wm = a[i][j];
          wmx = i + 1;
          wmy = j + 1;
        }
      } else {
        if (a[i][j] > bm) {
          bm = a[i][j];
          bmx = i + 1;
          bmy = j + 1;
        }
      }
    }
  cout << wm + bm << '\n';
  cout << wmx << ' ' << wmy << ' ' << bmx << ' ' << bmy << ' ';
  return 0;
}
