#include <bits/stdc++.h>
using namespace std;
long long v[4004], d[4004], p[4004], ans[4004], vis[4004], n;
long long fun(long long pos, long long vv, long long pp) {
  if (pos > n) return 0;
  if (vv < 0) vv = 0;
  if (vis[pos] == 0) {
    p[pos] -= (vv + pp);
    if (p[pos] < 0) {
      pp += d[pos];
      vis[pos] = 1;
    }
    fun(pos + 1, vv - 1, pp);
  } else
    fun(pos + 1, vv, pp);
  return 0;
}
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> v[i] >> d[i] >> p[i];
  long long ind = 0;
  long long vv = 0, pp = 0, cnt = 0;
  for (long long i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      cnt++;
      ans[ind++] = i;
      fun(i + 1, v[i], 0);
    }
  }
  cout << cnt << endl;
  for (long long i = 0; i < cnt; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
