#include <bits/stdc++.h>
using namespace std;
const long long inf = 9e18;
const double pi = acos(-1.0);
const long long M = 1e9 + 7;
const long long N = 1e5 + 5;
long long power(long long b, long long n) {
  long long ans(1);
  while (n) {
    if (n & 1) ans = (ans * b) % M;
    b = (b * b) % M;
    n >>= 1;
  }
  return ans;
}
map<pair<long long, long long>, pair<long long, long long> > m;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, f(1), s1(0), s2(0);
  cin >> n;
  double r(0.0);
  for (long long i = 0; i < n; ++i) {
    long long a[3];
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a + 3);
    if (r < 1.0 * a[0] / 2) {
      r = 1.0 * a[0] / 2;
      f = 1, s1 = i;
    }
    if (r < 1.0 * (min(a[1], m[{a[1], a[2]}].first + a[0])) / 2) {
      r = 1.0 * (min(a[1], m[{a[1], a[2]}].first + a[0])) / 2;
      f = 2, s1 = i, s2 = m[{a[1], a[2]}].second;
    }
    if (m[{a[1], a[2]}].first < a[0]) m[{a[1], a[2]}] = {a[0], i};
  }
  cout << f << endl;
  if (f == 1)
    cout << s1 + 1;
  else
    cout << s1 + 1 << ' ' << s2 + 1;
}
