#include <bits/stdc++.h>
using namespace std;
int n, num[4005];
struct st {
  int v, d, p;
} qe[4005];
int main() {
  cin >> n;
  int i, j, k, data;
  for (i = 1; i <= n; i++) scanf("%d%d%d", &qe[i].v, &qe[i].d, &qe[i].p);
  j = 0;
  for (i = 1; i <= n; i++)
    if (qe[i].p >= 0) {
      j++;
      num[j] = i;
      data = 0;
      int x = qe[i].v;
      for (k = i + 1; k <= n; k++) {
        if (qe[k].p < 0)
          continue;
        else {
          qe[k].p -= (x + data);
          if (qe[k].p < 0) {
            data += qe[k].d;
            data = min(data, 1000001);
          }
          x--;
          x = max(0, x);
        }
      }
    }
  cout << j << endl;
  for (i = 1; i <= j; i++) printf("%d ", num[i]);
  return 0;
}
