#include <bits/stdc++.h>
using namespace std;
void RI() {}
template <typename... T>
void RI(int& head, T&... tail) {
  scanf("%d", &head);
  RI(tail...);
}
mt19937 rng(0x5EED);
int randint(int lb, int ub) {
  return uniform_int_distribution<int>(lb, ub)(rng);
}
const int MX = 4005;
long long N, p[MX], v[MX], d[MX];
vector<long long> ans;
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  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;
    ans.push_back(i);
    long long sum = 0;
    int j = i + 1;
    for (int k = 0; j <= N && k < v[i]; k++, j++) {
      if (p[j] < 0) {
        k--;
        continue;
      }
      p[j] -= v[i] - k + sum;
      p[j] = max(p[j], -1LL);
      if (p[j] < 0) {
        sum += d[j];
        sum = min(sum, 1000005LL);
      }
    }
    for (; j <= N; j++) {
      if (p[j] < 0) {
        continue;
      }
      p[j] -= sum;
      p[j] = max(p[j], -1LL);
      if (p[j] < 0) {
        sum += d[j];
        sum = min(sum, 1000005LL);
      }
    }
  }
  int c = ans.size();
  cout << c << endl;
  for (int i = 0; i < c; i++) {
    cout << ans[i] << (i == c ? '\n' : ' ');
  }
  return 0;
}
