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