#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int N = 4010;
long long n, k, m, v, d, p;
vector<int> ans;
struct point {
  long long v;
  long long d;
  long long p;
} a[N];
long long max(long long x, long long y) { return x > y ? x : y; }
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> v >> d >> p;
    a[i].v = v;
    a[i].d = d;
    a[i].p = p;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i].p >= 0)
      ans.push_back(i);
    else
      continue;
    v = a[i].v;
    d = 0;
    for (int j = i + 1; j <= n; j++) {
      if (a[j].p < 0) continue;
      a[j].p -= v;
      a[j].p -= d;
      v--;
      v = max(v, 0);
      if (a[j].p < 0) d += a[j].d;
    }
  }
  cout << ans.size() << '\n';
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
