#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, pair<long long, long long> > > arr;
vector<long long> like;
int main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    arr.push_back(make_pair(a, make_pair(b, c)));
  }
  for (long long i = 0; i < n; i++) {
    long long cnt = 0;
    long long q = arr[i].first;
    if (arr[i].second.second < 0) continue;
    for (long long j = i + 1; j < n; j++) {
      if (arr[j].second.second < 0) continue;
      arr[j].second.second -= cnt;
      if (q > 0) arr[j].second.second -= q;
      q--;
      if (arr[j].second.second < 0) {
        cnt += arr[j].second.first;
      }
    }
    if (arr[i].second.second >= 0) like.push_back(i + 1);
  }
  cout << like.size() << endl;
  for (long long i = 0; i < like.size(); i++) cout << like[i] << " ";
}
