#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, ma = 0, indx1 = -1, indx2 = -1, sum = 0;
  cin >> n;
  map<pair<int, int>, vector<pair<int, int> > > map;
  int arr[n][3];
  for (i = 0; i < n; i++) {
    cin >> arr[i][0] >> arr[i][1] >> arr[i][2];
    sort(arr[i], arr[i] + 3);
    map[make_pair(arr[i][1], arr[i][2])].push_back(make_pair(arr[i][0], i));
  }
  for (auto it = map.begin(); it != map.end(); it++) {
    if ((it->second).size() == 1) {
      if ((it->second)[0].first > ma) {
        indx1 = (it->second)[0].second;
        indx2 = -1;
        ma = (it->second)[0].first;
      }
    } else {
      int num = (it->first).first;
      if (num > ma) {
        sort((it->second).rbegin(), (it->second).rend());
        int sum = (it->second)[0].first + (it->second)[1].first;
        if (sum > num) {
          ma = num;
          indx1 = (it->second)[0].second;
          indx2 = (it->second)[1].second;
        } else {
          if (sum > ma) {
            ma = sum;
            indx1 = (it->second)[0].second;
            indx2 = (it->second)[1].second;
          }
        }
      }
    }
  }
  if (indx2 == -1) {
    cout << "1"
         << "\n";
    cout << indx1 + 1 << "\n";
  } else {
    cout << "2"
         << "\n";
    cout << indx1 + 1 << " " << indx2 + 1 << "\n";
  }
  return 0;
}
