#include <bits/stdc++.h>
int n, vis[4001], res, ans[4001];
long long v[4001], p[4001], d[4001];
int main() {
  while (~scanf("%d", &n)) {
    memset(vis, 0, sizeof(vis));
    res = 0;
    for (int i = 1; i <= n; i++) scanf("%lld %lld %lld", &v[i], &d[i], &p[i]);
    for (int i = 1; i <= n; i++) {
      if (vis[i]) continue;
      ans[res++] = i;
      long long temp1 = v[i], temp2 = 0;
      for (int j = i + 1; j <= n; j++)
        if (!vis[j]) {
          p[j] -= temp1;
          temp1--;
          if (temp1 < 0) break;
        }
      for (int j = i + 1; j <= n; j++) {
        if (!vis[j]) p[j] -= temp2;
        if (p[j] < 0 && !vis[j]) {
          temp2 += d[j];
          vis[j] = 1;
        }
      }
    }
    printf("%d\n", res);
    for (int i = 0; i < res; i++)
      printf("%d%c", ans[i], i == res - 1 ? '\n' : ' ');
  }
  return 0;
}
