#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long v[n], d[n], p[n];
  vector<long long> ra;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
    ra.push_back(i + 1);
  }
  long long i = 0;
  vector<long long> ans;
  while (ra.size() != 0) {
    long long val = ra.front();
    ra.erase(ra.begin());
    ans.push_back(val);
    long long j = 0, k = 0;
    long long ini = 0;
    while (j < ra.size()) {
      if (v[val - 1]) {
        p[ra[j] - 1] -= ini + v[val - 1];
        v[val - 1] -= 1;
      } else {
        p[ra[j] - 1] -= ini;
      }
      if (p[ra[j] - 1] < 0) {
        ini += d[ra[j] - 1];
        ra.erase(ra.begin() + j);
        j--;
      }
      j++;
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
