#include <bits/stdc++.h>
using namespace std;
stack<time_t> time_stack;
void startTimer() { time_stack.push(clock()); }
double stopTimer() {
  double time = clock() - time_stack.top();
  time_stack.pop();
  return time / double(CLOCKS_PER_SEC);
}
long long v[4010], d[4010];
list<pair<long long, int> > p;
int main() {
  startTimer();
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i];
    int x;
    cin >> x;
    p.push_back(make_pair(x, i));
  }
  vector<int> ans;
  while (p.size() > 0) {
    long long v0 = v[p.front().second], d0 = 0;
    ans.push_back(p.front().second + 1);
    p.pop_front();
    auto it = p.begin();
    list<list<pair<long long, int> >::iterator> to_erase;
    for (long long i = v0; it != p.end(); i--, ++it) {
      if (i < 0) i = 0;
      it->first -= i + d0;
      if (it->first < 0) {
        d0 += d[it->second];
        to_erase.push_back(it);
      }
    }
    for (auto it : to_erase) p.erase(it);
  }
  cout << ans.size() << endl;
  for (auto it : ans) cout << it << " ";
  cout << endl;
  return 0;
}
