#include <bits/stdc++.h>
using namespace std;
class Solution {
  struct Child {
    long long v, d, p;
  } A[4000];
  int n;

 public:
  void run() {
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> A[i].v >> A[i].d >> A[i].p;
    vector<int> ans;
    for (int i = 0; i < n; ++i) {
      if (A[i].p == -1) continue;
      ans.push_back(i + 1);
      vector<bool> cry(n);
      for (int j = i + 1; A[i].v and j < n; ++j) {
        if (A[j].p == -1) continue;
        A[j].p = max(-1ll, A[j].p - A[i].v--);
        if (A[j].p < 0) cry[j] = 1;
      }
      long long sound = 0;
      for (int j = i + 1; j < n; ++j) {
        if (cry[j]) sound += A[j].d;
        if (A[j].p == -1) continue;
        A[j].p = max(-1ll, A[j].p - sound);
        if (A[j].p == -1) sound += A[j].d;
      }
    }
    cout << ans.size() << '\n';
    for (int i = 0; i < ans.size(); ++i)
      cout << ans[i] << " \n"[i == ans.size() - 1];
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  Solution().run();
}
