#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4005;
long long int v[MAXN], p[MAXN], d[MAXN];
int main() {
  int n, ans = 0;
  int inter[MAXN];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  for (int i = 1; i <= n; i++) {
    if (p[i] < 0) {
      continue;
    }
    inter[ans++] = i;
    long long int tempv = v[i], tempd = 0;
    for (int j = i + 1; j <= n; j++) {
      if (p[j] < 0) {
        continue;
      }
      if (p[j] >= 0) {
        p[j] -= (tempv + tempd);
        tempv = (tempv - 1) > 0 ? (tempv - 1) : 0;
        if (p[j] < 0) {
          tempd += d[j];
        }
      }
    }
  }
  cout << ans << endl;
  for (int i = 0; i < ans; i++) {
    cout << inter[i];
    if (i != ans - 1) {
      cout << ' ';
    }
  }
  cout << endl;
  return 0;
}
