#include <bits/stdc++.h>
using namespace std;
typedef struct s {
  int a, b, c, no;
} marble;
const int maxn = 100010;
marble stone[maxn];
bool cmp(const marble &s, const marble &t) {
  if (s.c > t.c)
    return 1;
  else if (s.c == t.c) {
    if (s.b > t.b)
      return 1;
    else if (s.b == t.b)
      return s.c > t.c;
  }
  return 0;
}
int main() {
  int n;
  int ma = 0, p1 = 0, p2 = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a, b, c, s, x, y;
    scanf("%d%d%d", &a, &b, &c);
    s = a + b + c;
    x = max(a, b);
    x = max(x, c);
    y = min(a, b);
    y = min(y, c);
    stone[i].a = y;
    stone[i].b = s - x - y;
    stone[i].c = x;
    stone[i].no = i + 1;
  }
  sort(stone, stone + n, cmp);
  for (int i = 0; i < n; i++)
    if (stone[i].a > ma) {
      ma = stone[i].a;
      p1 = i;
    }
  for (int i = 0; i < n - 1; i++)
    if (stone[i].b == stone[i + 1].b && stone[i].c == stone[i + 1].c) {
      if (stone[i].a + stone[i + 1].a > stone[i].b) {
        if (stone[i].b > ma) {
          ma = stone[i].b;
          p1 = i;
          p2 = i + 1;
        }
      } else if (stone[i].a + stone[i + 1].a > ma) {
        ma = stone[i].a + stone[i + 1].a;
        p1 = i;
        p2 = i + 1;
      }
    }
  if (p2 != 0)
    printf("2\n%d %d\n", stone[p1].no, stone[p2].no);
  else
    printf("1\n%d\n", stone[p1].no);
  return 0;
}
