#include <bits/stdc++.h>
long long v[4010], d[4010], p[4010], Q[4010], next[4010], last, ans[4010];
int main() {
  register int n;
  register long long sum, anscnt = 0;
  scanf("%d", &n);
  for (register int i = 1; i <= n; ++i)
    scanf("%d %d %d", v + i, d + i, p + i), next[i] = i + 1;
  for (register int i = 1; i <= n; i = next[i]) {
    ans[++anscnt] = last = i, sum = 0;
    for (register int j = next[i], k = v[i]; j <= n; j = next[j])
      p[j] -= k + sum, k > 0 ? --k : 1, 0 > p[j] ? sum += d[j],
          next[last] = next[j] : last = j;
  }
  printf("%I64d\n", anscnt);
  for (register int i = 1; i <= anscnt; ++i) printf("%I64d ", ans[i]);
  return 0;
}
