#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int v[4010], p[4010], d[4010], vis[4010];
vector<int> ans;
queue<int> q;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> v[i] >> d[i] >> p[i];
  memset(vis, 0, sizeof(vis));
  ans.clear();
  for (int i = 1; i <= n; i++) {
    if (p[i] >= 0 && vis[i] == 0) {
      ans.push_back(i);
      for (int j = i + 1; j <= n; j++) {
        if (vis[j] == 1) continue;
        if (p[j] < 0) {
          vis[j] = 1;
          q.push(j);
          continue;
        }
        p[j] -= v[i];
        if (p[j] < 0) {
          vis[j] = 1;
          q.push(j);
        }
        v[i]--;
        if (v[i] <= 0) break;
      }
      while (!q.empty()) {
        int t = q.front();
        for (int i = t + 1; i <= n; i++) {
          p[i] -= d[t];
          if (p[i] < 0 && vis[i] == 0) {
            vis[i] = 1;
            q.push(i);
          }
        }
        q.pop();
      }
    }
  }
  int sum = ans.size();
  cout << sum << endl;
  for (int i = 0; i <= sum - 1; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
