#include <bits/stdc++.h>
using namespace std;
long long v[(4000 + 10)];
long long d[(4000 + 10)];
long long p[(4000 + 10)];
long long N;
int main() {
  cin >> N;
  for (long long i = 0; i < N; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  long long a = 0;
  long long b = 0;
  vector<long long> all;
  while (true) {
    long long idx = -1;
    for (long long i = 0; i < N; i++)
      if (p[i] >= 0) {
        idx = i;
        break;
      }
    if (idx == -1) break;
    all.push_back(idx);
    a = v[idx];
    b = 0;
    for (long long i = idx + 1; i < N; i++) {
      if (p[i] >= 0) {
        p[i] -= a + b;
        if (a >= 1) a--;
        if (p[i] < 0) b += d[i];
      }
    }
    p[idx] = -1;
  }
  cout << ((long long)(all).size()) << endl;
  for (long long t : all) {
    cout << t + 1 << ' ';
  }
  cout << endl;
  return 0;
}
