#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++i) {
    if (i != v.begin()) os << ", ";
    os << *i;
  }
  os << "]";
  return os;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<vector<int> > A(n, vector<int>(n));
  vector<long long> SP(2 * n - 1, 0), SN(2 * n - 1, 0);
  for (int i = 0; i < (int)(n); ++i)
    for (int j = 0; j < (int)(n); ++j) {
      scanf("%d", &A[i][j]);
      SP[i + j] += A[i][j];
      SN[i - j + n - 1] += A[i][j];
    }
  long long best[2] = {-1, -1};
  int res_i[2];
  int res_j[2];
  for (int i = 0; i < (int)(n); ++i)
    for (int j = 0; j < (int)(n); ++j) {
      int p = (i + j) % 2;
      long long x = SP[i + j] + SN[i - j + n - 1] - A[i][j];
      if (best[p] < x) {
        best[p] = x;
        res_i[p] = i;
        res_j[p] = j;
      }
    }
  cout << best[0] + best[1] << endl;
  cout << res_i[0] + 1 << " " << res_j[0] + 1 << " " << res_i[1] + 1 << " "
       << res_j[1] + 1 << endl;
}
