#include <bits/stdc++.h>
using namespace std;
vector<int> chk;
int main() {
  int n;
  scanf("%d", &n);
  long long int a[n][3];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 3; j++) {
      scanf("%lld", &a[i][j]);
    }
  }
  chk.clear();
  for (int i = 0; i < n; i++) {
    if (a[i][2] >= 0) {
      chk.push_back(i + 1);
      long long int chila = a[i][0];
      long long int tr = i + 1;
      long long int chikh = 0;
      while ((chila || chikh) && tr < n) {
        if (a[tr][2] >= 0) {
          a[tr][2] = a[tr][2] - chila - chikh;
          if (a[tr][2] < 0) {
            chikh = chikh + a[tr][1];
          }
          if (chila > 0) chila--;
        }
        tr++;
      }
    }
  }
  printf("%d\n", (int)chk.size());
  for (int i = 0; i < chk.size(); i++) {
    printf("%d ", chk[i]);
  }
  printf("\n");
  return 0;
}
