#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
struct Node {
  int a[3], idx;
  bool operator<(const Node& ano) const {
    if (a[1] == ano.a[1]) {
      if (a[2] == ano.a[2]) return a[0] < ano.a[0];
      return a[2] < ano.a[2];
    }
    return a[1] < ano.a[1];
  }
} t[N];
int main() {
  int n;
  cin >> n;
  double ans1 = 0;
  int k1 = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 3; j++) scanf("%d", &t[i].a[j]);
    t[i].idx = i;
    sort(t[i].a, t[i].a + 3);
    if (ans1 < 0.5 * t[i].a[0]) {
      ans1 = 0.5 * t[i].a[0];
      k1 = i;
    }
  }
  sort(t + 1, t + 1 + n);
  double ans2 = 0;
  int k21 = 0, k22 = 0;
  for (int i = 2; i <= n; i++) {
    if (i != n && t[i].a[0] == t[i + 1].a[0] && t[i].a[2] == t[i + 1].a[2] &&
        t[i].a[1] == t[i + 1].a[1]) {
      continue;
    }
    if (t[i].a[2] == t[i - 1].a[2] && t[i].a[1] == t[i - 1].a[1]) {
      int nlen = t[i].a[0] + t[i - 1].a[0];
      int minlen = min(t[i].a[1], min(t[i].a[2], nlen));
      if (ans2 < 0.5 * minlen) {
        ans2 = 0.5 * minlen;
        k21 = t[i - 1].idx, k22 = t[i].idx;
      }
    }
  }
  if (ans1 >= ans2)
    cout << "1\n" << k1 << endl;
  else
    cout << "2\n" << k21 << " " << k22 << endl;
}
