#include <bits/stdc++.h>
using namespace std;
pair<long, long> small(pair<long, long> a, pair<long, long> b) {
  if (a > b)
    return b;
  else
    return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, indx1, indx2;
  long a, b, c;
  long r, maxr = 0;
  map<pair<long, long>, priority_queue<pair<long, int> > > mp;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c;
    mp[small({a, b}, {b, a})].push({c, i + 1});
    if (small({a, b}, {b, a}) != small({b, c}, {c, b}))
      mp[small({b, c}, {c, b})].push({a, i + 1});
    if (small({c, a}, {a, c}) != small({a, b}, {b, a}) &&
        small({c, a}, {a, c}) != small({b, c}, {c, b}))
      mp[small({c, a}, {a, c})].push({b, i + 1});
  }
  for (auto it = mp.begin(); it != mp.end(); it++) {
    long temp = (*it).second.top().first;
    int id1 = 0, id2 = 0;
    a = (*it).first.first;
    b = (*it).first.second;
    id1 = (*it).second.top().second;
    (*it).second.pop();
    if (!((*it).second.empty())) {
      temp += (*it).second.top().first;
      id2 = (*it).second.top().second;
    }
    r = min(a, min(b, temp));
    if (r > maxr) {
      indx1 = id1;
      indx2 = id2;
      maxr = r;
    }
  }
  if (indx2)
    cout << 2 << "\n" << indx1 << " " << indx2;
  else
    cout << 1 << "\n" << indx1;
  return 0;
}
