#include <bits/stdc++.h>
using namespace std;
const int oo = 1e5;
int N;
long long int v, d, p;
vector<int> ans;
vector<pair<long long int, pair<long long int, long long int> > > child;
int main() {
  scanf("%d", &N);
  for (int(i) = 0; (i) < (int)(N); (i)++) {
    scanf("%lld %lld %lld", &v, &d, &p);
    child.push_back(make_pair(v, make_pair(d, p)));
  }
  for (int(i) = 0; (i) < (int)(N); (i)++) {
    if (child[i].second.second >= 0) {
      ans.push_back(i + 1);
      long long int vi = child[i].first, dj = 0;
      for (int(j) = (i + 1); (j) < (int)(N); (j)++) {
        if (child[j].second.second >= 0) {
          child[j].second.second =
              child[j].second.second - max(vi, (long long int)0) - dj;
          vi--;
          if (child[j].second.second < 0) dj += child[j].second.first;
        }
      }
    }
  }
  printf("%d\n", (int)ans.size());
  for (int(i) = 0; (i) < (int)(ans.size()); (i)++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
