#include <bits/stdc++.h>
using namespace std;
void Solve() {
  long long V[4005];
  long long D[4005];
  long long P[4005];
  int children_count = 0;
  int Output[4005] = {0};
  int next[4005] = {0};
  int N = 0;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> V[i] >> D[i] >> P[i];
    next[i] = i + 1;
  }
  next[N - 1] = -1;
  for (int head = 0; head >= 0; head = next[head]) {
    Output[children_count++] = head + 1;
    long long a = V[head];
    long long b = 0;
    int first = -1;
    int pre = head;
    int current = next[head];
    while (current >= 0) {
      P[current] -= a + b;
      if (P[current] < 0) {
        b += D[current];
        next[pre] = next[current];
      } else {
        pre = current;
      }
      if (a > 0) {
        --a;
      }
      current = next[current];
    }
  }
  cout << children_count << endl;
  for (int i = 0; i < children_count; ++i) {
    cout << Output[i] << " ";
  }
  cout << endl;
}
int main() {
  int tc = 1;
  while (tc > 0) {
    Solve();
    --tc;
  }
}
