#include <bits/stdc++.h>
using namespace std;
int n;
long long v[4010], d[4010], p[4010];
set<int> remain, rem;
int main(void) {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
    remain.insert(i);
  }
  vector<int> tot;
  while ((int)remain.size() > 0) {
    rem.clear();
    int i = *remain.begin();
    remain.erase(remain.begin());
    tot.push_back(i + 1);
    long long sub = v[i], ex = 0;
    for (int j : remain) {
      p[j] -= sub + ex;
      if (p[j] < 0) {
        p[j] = 0;
        rem.insert(j);
        ex += d[j];
      }
      sub--;
      if (sub < 0) sub = 0;
    }
    for (int j : rem) {
      remain.erase(remain.find(j));
    }
  }
  cout << tot.size() << "\n";
  if (tot.size() > 0) {
    for (int i = 0; i < tot.size(); i++) {
      cout << tot[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
