#include <bits/stdc++.h>
using namespace std;
long long n;
struct node {
  long long v, d, p;
} a[4003];
signed main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i].v >> a[i].d >> a[i].p;
  vector<long long> ans;
  ans.clear();
  for (long long i = 1; i <= n; i++) {
    if (a[i].p < 0) continue;
    ans.push_back(i);
    long long t = a[i].v, d = 0;
    for (long long j = i + 1; j <= n; j++) {
      if (a[j].p < 0) continue;
      a[j].p -= (t + d);
      if (a[j].p < 0) d += a[j].d;
      t = max(t - 1, 0ll);
    }
  }
  cout << (long long)ans.size() << "\n";
  for (auto v : ans) cout << v << " ";
  return 0;
}
