#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
const long long inf = 1LL << 30;
const double eps = 1e-9;
const long long mod = 1e9 + 7;
const int N = 5050;
vector<int> ans;
pair<pair<long long, long long>, long long> a[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%lld%lld%lld", &a[i].first.first, &a[i].first.second, &a[i].second);
  for (int i = 1; i <= n; i++) {
    if (a[i].second < 0) continue;
    ans.push_back(i);
    long long dec = 0;
    for (int j = i + 1; j <= n; j++) {
      if (a[j].second < 0) continue;
      a[j].second -= max(a[i].first.first, 0LL) + dec;
      a[i].first.first--;
      if (a[j].second < 0) dec += a[j].first.second;
    }
  }
  printf("%d\n", ans.size());
  for (auto x : ans) printf("%d ", x);
}
