#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int N = 4 * 1e3 + 5;
long long diag1[N], diag2[N];
int board[N][N];
int main() {
  int n, x;
  scanf("%d", &n);
  for (int r = (0); r < (n); ++r) {
    for (int c = (0); c < (n); ++c) {
      scanf("%d", &x);
      board[r][c] = x;
      diag1[r + c] += x;
      diag2[n - r + c] += x;
    }
  }
  long long score[2] = {-1, -1};
  pair<int, int> bishop[2] = {};
  for (int r = (0); r < (n); ++r) {
    for (int c = (0); c < (n); ++c) {
      if (diag1[r + c] + diag2[n - r + c] - board[r][c] > score[(r + c) % 2]) {
        score[(r + c) % 2] = diag1[r + c] + diag2[n - r + c] - board[r][c];
        bishop[(r + c) % 2] = {r, c};
      }
    }
  }
  cout << score[0] + score[1] << endl;
  printf("%d %d %d %d\n", bishop[0].first + 1, bishop[0].second + 1,
         bishop[1].first + 1, bishop[1].second + 1);
  return 0;
}
