#include <bits/stdc++.h>
static const double DEG_TO_RAD = 0.017453292519943295769236907684886;
static const double EARTH_RADIUS_IN_METERS = 6371.01;
using namespace std;
long long n;
vector<long long> kq;
struct query {
  long long v, d, p, stt;
} qqq;
vector<query> q;
void solve() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> qqq.v >> qqq.d >> qqq.p;
    qqq.stt = i;
    q.push_back(qqq);
  }
  for (int i = 0; i < q.size(); i++)
    if (q[i].p >= 0) {
      kq.push_back(q[i].stt);
      long long k = 0;
      for (int j = i + 1; j < q.size(); j++)
        if (k > q[i].v)
          break;
        else if (q[j].p >= 0) {
          q[j].p -= q[i].v - k;
          k++;
        }
      k = 0;
      int j = i + 1;
      while (j < q.size()) {
        q[j].p -= k;
        if (q[j].p >= 0)
          j++;
        else {
          k += q[j].d;
          q.erase(q.begin() + j);
        }
      }
    }
  cout << kq.size() << endl;
  for (int i = 0; i < kq.size(); i++) cout << kq[i] << " ";
}
int main() { solve(); }
