#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> v(n), d(n), p(n);
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    scanf("%lld %lld %lld", &v[i], &d[i], &p[i]);
  }
  queue<int> q;
  for (int i = 0; i < n; i++) {
    if (p[i] < 0) continue;
    ans.push_back(i + 1);
    for (int j = i + 1; j < n && v[i] > 0; j++) {
      if (p[j] < 0) continue;
      p[j] -= (v[i]--);
      if (p[j] < 0) q.push(j);
    }
    while (!q.empty()) {
      auto r = q.front();
      q.pop();
      for (int j = r + 1; j < n; j++) {
        p[j] -= d[r];
        if (p[j] + d[r] >= 0 && p[j] < 0) q.push(j);
      }
    }
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  return 0;
}
