#include <bits/stdc++.h>
using vi = std::vector<int64_t>;
using vvi = std::vector<vi>;
struct N {
  int x;
  int y;
  int64_t sum;
};
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n;
  std::cin >> n;
  vvi a(n, vi(n));
  vvi m(n, vi(n));
  int diags = 2 * n - 1;
  vi d1(diags), d2(diags);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      std::cin >> a[i][j];
      d1[i + j] += a[i][j];
      d2[i - j + n - 1] += a[i][j];
    }
  }
  std::vector<N> best({{0, 0, 0}, {0, 1, 0}});
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int64_t sum = d1[i + j] - a[i][j] + d2[i - j + n - 1];
      int b = (i + j) % 2;
      if (sum > best[b].sum) {
        best[b] = {i, j, sum};
      }
    }
  }
  std::cout << best[0].sum + best[1].sum << std::endl;
  std::cout << best[0].x + 1 << " " << best[0].y + 1 << " " << best[1].x + 1
            << " " << best[1].y + 1 << std::endl;
}
