#include <bits/stdc++.h>
using namespace std;
struct kid {
  long long v, d, p;
} kid[4000];
int n, c;
vector<int> ans;
bool out[4000];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    scanf("%I64d%I64d%I64d", &kid[i].v, &kid[i].d, &kid[i].p);
  for (int i = 0; i < n; i++) {
    long long d = 0;
    if (kid[i].p < 0) continue;
    c++;
    ans.push_back(i + 1);
    for (int j = i + 1; j < n; j++) {
      if (out[j]) continue;
      kid[j].p -= kid[i].v + d;
      if (kid[j].p < 0) d += kid[j].d, out[j] = true;
      if (kid[i].v > 0) kid[i].v--;
    }
  }
  printf("%d\n", c);
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
}
