#include <bits/stdc++.h>
using namespace std;
struct node {
  long long a, b, c;
  int d;
} s[100005];
long long cmp(int q, int p) { return q < p; }
long long cmp1(node q, node p) {
  if (q.b != p.b)
    return q.b < p.b;
  else {
    if (q.c != p.c)
      return q.c < p.c;
    else {
      return q.a < p.a;
    }
  }
}
int n, ans1, ans2, w;
long long d[3], maxx;
int main() {
  scanf("%d", &n);
  maxx = 0;
  for (int i = 0; i < n; i++) {
    scanf("%I64d%I64d%I64d", &s[i].a, &s[i].b, &s[i].c);
    s[i].d = i + 1;
    d[0] = s[i].a;
    d[1] = s[i].b;
    d[2] = s[i].c;
    sort(d, d + 3, cmp);
    s[i].a = d[0];
    s[i].b = d[1];
    s[i].c = d[2];
    if (s[i].a > maxx) {
      w = 1;
      maxx = s[i].a;
      ans1 = i + 1;
    }
  }
  sort(s, s + n, cmp1);
  for (int i = n - 1; i >= 1; i--) {
    if (s[i].b <= maxx) break;
    for (int j = i - 1; j >= 0; j--) {
      if ((s[i].a + s[j].a) <= maxx)
        break;
      else {
        if (s[i].b != s[j].b)
          break;
        else {
          if (s[i].c != s[j].c)
            break;
          else {
            if ((s[i].a + s[j].a) > s[i].b) {
              if (s[i].b > maxx) {
                w = 2;
                maxx = s[i].b;
                if (s[i].d < s[j].d) {
                  ans1 = s[i].d;
                  ans2 = s[j].d;
                } else {
                  ans1 = s[j].d;
                  ans2 = s[i].d;
                }
              }
            } else {
              if ((s[i].a + s[j].a) > maxx) {
                w = 2;
                maxx = (s[i].a + s[j].a);
                if (s[i].d < s[j].d) {
                  ans1 = s[i].d;
                  ans2 = s[j].d;
                } else {
                  ans1 = s[j].d;
                  ans2 = s[i].d;
                }
              }
            }
          }
        }
      }
    }
  }
  if (w == 1) {
    printf("1\n");
    printf("%d\n", ans1);
  } else if (w == 2) {
    printf("2\n");
    printf("%d %d\n", ans1, ans2);
  }
}
