#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
long long chess[5][2004][2004];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int N, r1, r2, c1, c2;
  cin >> N;
  for (int i = 1; i < N + 1; i += 1)
    for (int j = 1; j < N + 1; j += 1)
      cin >> chess[0][i][j],
          chess[1][i][j] = chess[0][i][j] + chess[1][i - 1][j - 1],
          chess[2][i][j] = chess[0][i][j] + chess[2][i - 1][j + 1];
  for (int i = N; i >= 1; i -= 1)
    for (int j = N; j >= 1; j -= 1)
      chess[3][i][j] = chess[0][i][j] + chess[3][i + 1][j + 1],
      chess[4][i][j] = chess[0][i][j] + chess[4][i + 1][j - 1];
  long long ec = -1, oc = -1, t;
  for (int i = 1; i < N + 1; i += 1)
    for (int j = 1; j < N + 1; j += 1) {
      t = chess[0][i][j] + chess[1][i - 1][j - 1] + chess[2][i - 1][j + 1] +
          chess[3][i + 1][j + 1] + chess[4][i + 1][j - 1];
      if (i + j & 1 && oc < t)
        r1 = i, c1 = j, oc = t;
      else if ((i + j & 1) == 0 && ec < t)
        r2 = i, c2 = j, ec = t;
    }
  cout << oc + ec << '\n' << r1 << ' ' << c1 << ' ' << r2 << ' ' << c2 << '\n';
}
