#include <bits/stdc++.h>
const long long inf = 0x3f3f3f3f3f3f3f3LL;
const long long mod = (long long)1e9 + 7;
using namespace std;
template <class T>
void smin(T& a, T val) {
  if (a > val) a = val;
}
template <class T>
void smax(T& a, T val) {
  if (a < val) a = val;
}
const long long N = 4 * (long long)1e3 + 10;
long long n, v[N], d[N], p[N];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) {
    cin >> v[i] >> d[i] >> p[i];
  }
  vector<long long> vals;
  for (long long i = 0; i < n; ++i) {
    if (p[i] < 0) continue;
    vals.push_back(i + 1);
    long long ptr = v[i], inc2 = 0;
    for (long long j = i + 1; j < n; ++j) {
      if (p[j] < 0) continue;
      p[j] -= ptr;
      p[j] -= inc2;
      --ptr;
      smax(ptr, 0LL);
      if (p[j] < 0) inc2 += d[j];
    }
  }
  cout << (long long)(vals.size()) << '\n';
  for (auto it : vals) cout << it << ' ';
  return 0;
}
