#include <bits/stdc++.h>
using namespace std;
const int t = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<long long> p(n), v(n), d(n);
  for (int i = 0; i < n; i++) cin >> v[i] >> d[i] >> p[i];
  queue<int> a;
  for (int i = 0; i < n; i++) a.push(i);
  vector<int> ans;
  int i = 0;
  while (!a.empty()) {
    i++;
    int curr = a.front();
    ans.push_back(curr + 1);
    a.pop();
    int t = v[curr];
    queue<int> buf;
    int sz = a.size();
    long long e = 0;
    while (!a.empty()) {
      int y = a.front();
      a.pop();
      int x = p[y];
      p[y] -= t;
      p[y] -= e;
      x = p[y];
      t = max(t - 1, 0);
      if (p[y] < 0) {
        e += d[y];
      } else {
        buf.push(y);
      }
    }
    a = buf;
  }
  cout << i << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
