#include <bits/stdc++.h>
using namespace std;
long long a[4001], b[4001], c[4001], v[4001], n, i, j, t, d;
bool p[4001];
int main() {
  cin >> n;
  for (j = 0; j < n; j++) cin >> a[j] >> b[j] >> c[j];
  while (i < n) {
    for (j = 0; j < n; j++) p[j] = c[j] >= 0;
    for (j = i + 1; j < n; j++) {
      if (p[j] && a[i] > 0) c[j] -= a[i]--;
      if (c[j] < 0 && p[j]) {
        for (t = j + 1; t < n; t++) c[t] -= b[j];
      }
    }
    if (c[i] >= 0) v[d++] = i + 1;
    while (c[++i] < 0)
      ;
  }
  cout << d << endl;
  for (i = 0; i < d; i++) cout << v[i] << " ";
}
