#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
long long v[4005], d[4005], p[4005];
bool mark[4005];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> v[i] >> d[i] >> p[i];
  for (int i = 1; i <= n; i++)
    if (!mark[i]) {
      mark[i] = true;
      ans.push_back(i);
      long long dd = 0;
      int cnt = 0;
      for (int j = i + 1; j <= n; j++)
        if (!mark[j]) {
          if (v[i] > cnt) {
            p[j] -= v[i] - cnt;
            cnt++;
          }
          p[j] -= dd;
          if (p[j] < 0) {
            dd += d[j];
            mark[j] = true;
          }
        }
    }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    if (i) cout << " ";
    cout << ans[i];
  }
}
