#include <bits/stdc++.h>
using namespace std;
using namespace std;
int n;
bool lev[6666];
int v[6666], d[6666], p[6666];
int main() {
  scanf("%d", &(n));
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d", &(v[i]), &(d[i]), &(p[i]));
  }
  vector<int> vec;
  for (int i = 1; i <= n; i++) {
    if (p[i] < 0 || lev[i]) {
      continue;
    } else {
      vec.push_back(i);
      int shanghai = v[i];
      queue<int> que;
      for (int j = i + 1; j <= n; j++) {
        if (shanghai == 0) break;
        p[j] -= shanghai;
        if (!lev[j]) shanghai--;
        if (!lev[j] && p[j] < 0) {
          que.push(j), lev[j] = true;
        }
      }
      while (!que.empty()) {
        int id = que.front();
        que.pop();
        for (int j = id + 1; j <= n; j++) {
          p[j] -= d[id];
          if (!lev[j] && p[j] < 0) que.push(j), lev[j] = true;
        }
      }
    }
  }
  cout << vec.size() << endl;
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i] << " ";
  }
  return 0;
}
