#include <bits/stdc++.h>
using namespace std;
long long v[10009], d[10009], p[10009];
vector<long long> a;
vector<long long> q;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%I64d%I64d%I64d", &v[i], &d[i], &p[i]);
    q.push_back(i);
  }
  while (q.size()) {
    a.push_back(q[0] + 1);
    int cv = v[q[0]];
    q.erase(q.begin() + 0);
    for (int j = 0; j < (int)q.size(); j++) {
      if (cv - j <= 0) break;
      p[q[j]] -= cv - j;
    }
    for (int j = 0; j < (int)q.size(); j++) {
      if (p[q[j]] < 0) {
        int cd = d[q[j]];
        q.erase(q.begin() + j);
        j--;
        for (int k = j + 1; k < (int)q.size(); k++) {
          p[q[k]] -= cd;
        }
      }
    }
  }
  printf("%d\n", a.size());
  for (int i = 0; i < a.size(); i++) {
    printf((i == a.size() - 1) ? "%d\n" : "%d ", a[i]);
  }
}
