#include <bits/stdc++.h>
using namespace std;
struct Child {
  long long v, d, p;
  Child() {}
  Child(long long _v, long long _d, long long _p) : v(_v), d(_d), p(_p) {}
};
int main() {
  int n;
  cin >> n;
  vector<Child> child;
  bool dead[4005];
  for (int i = (1); i <= (n); ++i) {
    long long v, t, p;
    cin >> v >> t >> p;
    child.emplace_back(v, t, p);
  }
  memset(dead, false, sizeof(dead));
  vector<int> ans;
  for (int i = (0); i <= (n - 1); ++i) {
    if (dead[i])
      continue;
    else {
      ans.emplace_back(i + 1);
      long long val = child[i].v;
      for (int j = (i + 1); j <= (n - 1); ++j) {
        if (dead[j]) continue;
        child[j].p -= val--;
        if (val == 0) break;
      }
      long long nowcry = 0;
      for (int j = (i + 1); j <= (n - 1); ++j) {
        if (dead[j]) continue;
        child[j].p -= nowcry;
        if (child[j].p < 0) {
          dead[j] = true;
          nowcry += child[j].d;
        }
      }
    }
  }
  cout << ans.size() << endl;
  for (auto val : ans) cout << val << " ";
  cout << endl;
  return 0;
}
