#include <bits/stdc++.h>
using namespace std;
vector<int> v, d, p;
int vis[5000];
int main() {
  int n;
  cin >> n;
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < n; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    v.push_back(x);
    d.push_back(y);
    p.push_back(z);
  }
  int i = 0;
  vector<int> ret;
  for (;;) {
    int k = 0;
    int l = 0;
    int b = 0;
    for (int j = 0; j < n; j++) {
      if (!vis[j]) {
        b = 1;
        vis[j] = 1;
        l = j;
        break;
      }
    }
    if (!b) break;
    for (int j = l + 1; j < n; j++) {
      if (!vis[j]) {
        p[j] -= v[l] - k;
        k++;
        if (k == v[l]) break;
      }
    }
    queue<int> Q;
    for (int j = l + 1; j < n; j++) {
      if (p[j] < 0 && !vis[j]) {
        vis[j] = 1;
        Q.push(j);
      }
    }
    if (Q.empty()) {
    }
    while (!Q.empty()) {
      int u = Q.front();
      Q.pop();
      for (int j = u + 1; j < n; j++) {
        if (!vis[j]) {
          p[j] -= d[u];
          if (p[j] < 0) {
            vis[j] = 1;
            Q.push(j);
          }
        }
      }
    }
  }
  int r = 1 << 30;
  for (int i = 0; i < n; i++) {
    if (p[i] >= 0) ret.push_back(i + 1);
  }
  cout << ret.size() << endl;
  for (int i = 0; i < ret.size(); i++) {
    cout << ret[i] << " ";
  }
  return 0;
}
