#include <bits/stdc++.h>
using namespace std;
pair<pair<int, int>, pair<int, int> > arr[100005];
int i, j, n, t, tc, l, r, a, b, c;
bool cmp(pair<pair<int, int>, pair<int, int> > a,
         pair<pair<int, int>, pair<int, int> > b) {
  if (a.first.second == b.first.second) {
    if (a.second.first == b.second.first)
      return a.second.second < b.second.second;
    return a.second.first < b.second.first;
  }
  return a.first.second < b.first.second;
}
int main() {
  double hasil = -1.0, temp;
  int pos1 = 0, pos2 = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d %d %d", &a, &b, &c);
    if (a > b) swap(a, b);
    if (a > c) swap(a, c);
    if (b > c) swap(b, c);
    swap(a, b);
    swap(b, c);
    if (hasil < (c / 2.0)) {
      pos1 = i + 1;
      pos2 = i + 1;
      hasil = c / 2.0;
    }
    arr[i] = make_pair(make_pair(i, a), make_pair(b, c));
  }
  sort(arr, arr + n, cmp);
  for (i = 0; i < n - 1; i++) {
    if (arr[i].first.second == arr[i + 1].first.second &&
        arr[i].second.first == arr[i + 1].second.first) {
      temp = min(arr[i].first.second,
                 min(arr[i].second.first,
                     arr[i].second.second + arr[i + 1].second.second)) /
             2.0;
      if (hasil < temp) {
        pos1 = arr[i].first.first + 1;
        pos2 = arr[i + 1].first.first + 1;
        hasil = temp;
        if (pos1 > pos2) swap(pos1, pos2);
      }
    }
  }
  if (pos1 == pos2)
    printf("1\n%d\n", pos1);
  else
    printf("2\n%d %d\n", pos1, pos2);
}
