#include <bits/stdc++.h>
using namespace std;
pair<int, pair<int, int> > arr[4003];
int ans[4003];
bool hereb[4003];
int main() {
  int n, k = 0, cur = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i)
    scanf("%d %d %d", &arr[i].first, &arr[i].second.first,
          &arr[i].second.second);
  while (cur < n) {
    if (hereb[cur]) {
      ++cur;
      continue;
    }
    ans[k++] = cur + 1;
    int x = 0;
    for (int i = cur + 1; i < n && x < arr[cur].first; ++i) {
      if (hereb[i]) continue;
      arr[i].second.second -= (arr[cur].first - x);
      ++x;
    }
    long long sum = 0;
    for (int i = cur + 1; i < n; ++i) {
      if (hereb[i]) continue;
      if (sum > (long long)arr[i].second.second) {
        hereb[i] = 1;
        sum += (long long)arr[i].second.first;
      } else
        arr[i].second.second -= sum;
    }
    ++cur;
  }
  printf("%d\n", k);
  for (int i = 0; i < k; ++i) {
    printf("%d", ans[i]);
    if (i + 1 < k) putchar(' ');
  }
  putchar('\n');
  return 0;
}
