#include <bits/stdc++.h>
using namespace std;
long long v[4005], d[4005], p[4005], alive[4005];
long long bef[4005], nxt[4005];
int main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
    alive[i] = 1;
    bef[i] = i - 1;
    nxt[i] = i + 1;
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    if (p[i] < 0) continue;
    ans++;
    long long k = i;
    for (long long j = v[i]; j > 0; j--) {
      k = nxt[k];
      if (k >= n) break;
      p[k] -= j;
    }
    k = i;
    while (1) {
      k = nxt[k];
      if (k >= n) break;
      if (p[k] < 0) {
        long long u = k;
        while (1) {
          u = nxt[u];
          if (u >= n) break;
          p[u] -= d[k];
        }
        nxt[bef[k]] = nxt[k];
        bef[nxt[k]] = bef[k];
      }
    }
  }
  cout << ans << endl;
  for (long long i = 0; i < n; i++) {
    if (p[i] >= 0) cout << i + 1 << " ";
  }
  return 0;
}
