#include <bits/stdc++.h>
using namespace std;
const int N = 4000;
int n;
long long v[N + 5], d[N + 5], p[N + 5];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld %lld %lld", v + i, d + i, p + i);
  }
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    if (p[i] >= 0) {
      long long t = v[i], t2 = 0;
      for (int j = i + 1; j <= n; j++) {
        if (p[j] >= 0) {
          p[j] -= t + t2;
          if (t) t--;
          if (p[j] < 0) t2 += d[j];
        }
      }
      ans.push_back(i);
    }
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i]);
  }
  puts("");
  return 0;
}
