#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:128000000")
int n;
vector<vector<int> > a;
vector<long long> d1, d2;
long long b1 = -1, b2 = -1;
pair<int, int> cell1(-1, -1), cell2(-1, -1);
inline void init() {
  scanf("%d", &n);
  a.resize(n);
  for (int i = 0; i < n; ++i) {
    a[i].resize(n);
    for (int j = 0; j < n; ++j) scanf("%d", &a[i][j]);
  }
  d1.assign(3 * n, 0LL);
  d2.assign(3 * n, 0LL);
}
int main() {
  init();
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      d1[i + j] += (long long)a[i][j];
      d2[i - j + n] += (long long)a[i][j];
    }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      long long cur = d1[i + j] + d2[i - j + n] - (long long)a[i][j];
      int color = (i + j) & 1;
      if (color) {
        if (b1 < cur) {
          b1 = cur;
          cell1 = pair<int, int>(i, j);
        }
      } else {
        if (b2 < cur) {
          b2 = cur;
          cell2 = pair<int, int>(i, j);
        }
      }
    }
  cout << b1 + b2 << endl;
  cout << cell1.first + 1 << " " << cell1.second + 1 << " " << cell2.first + 1
       << " " << cell2.second + 1 << endl;
  return 0;
}
