#include <bits/stdc++.h>
using namespace std;
int n;
long long v[4005], d[4005], p[4005];
bool lq[4005];
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%I64d%I64d%I64d", &v[i], &d[i], &p[i]);
    memset(lq, 0, sizeof(lq));
    vector<int> ans;
    for (int i = 1; i <= n; i++)
      if (!lq[i]) {
        ans.push_back(i);
        long long a = v[i], b = 0;
        for (int j = i + 1; j <= n; j++)
          if (!lq[j]) {
            p[j] = p[j] - (a + b);
            if (p[j] < 0) {
              lq[j] = 1;
              b = b + d[j];
            }
            if (a > 0) a--;
          }
      }
    printf("%d\n", ans.size());
    for (int i = 0; i < ans.size() - 1; i++) printf("%d ", ans[i]);
    printf("%d\n", ans[ans.size() - 1]);
  }
  return 0;
}
