#include <bits/stdc++.h>
using namespace std;
const int N = (4009), M = (1 << 20), OO = 0x3f3f3f3f;
int n;
long long V[N], D[N], P[N];
bool cried[N];
int ans;
queue<int> q;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%lld %lld %lld", V + i, D + i, P + i);
  for (int i = 0; i < n; ++i) {
    if (cried[i]) continue;
    int potential = V[i];
    long long fixed = 0;
    q.push(i + 1);
    for (int j = i + 1; j < n; ++j) {
      if (cried[j]) continue;
      P[j] -= potential;
      P[j] -= fixed;
      if (potential) --potential;
      if (P[j] < 0) fixed += D[j], cried[j] = 1;
    }
  }
  printf("%d\n", (int)q.size());
  while (!q.empty()) {
    printf("%d ", q.front());
    q.pop();
  }
  puts("");
  return 0;
}
