#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  long long int v[4000], d[4000], p[4000];
  for (int i = 0; i < N; i++) scanf("%lld %lld %lld", &v[i], &d[i], &p[i]);
  queue<int> ans;
  for (int i = 0; i < N; i++) {
    if (p[i] < 0) continue;
    for (long long int j = i + 1, dec = 0; j < N; j++) {
      if (p[j] < 0) continue;
      if (p[j] >= 0 && v[i]) p[j] -= v[i]--;
      p[j] -= dec;
      if (p[j] < 0) dec += d[j];
    }
    ans.push(i + 1);
  }
  int sz = ans.size();
  printf("%d\n", sz);
  for (int i = 1; i < sz; i++) {
    printf("%d ", ans.front());
    ans.pop();
  }
  printf("%d\n", ans.front());
  return 0;
}
