#include <bits/stdc++.h>
using namespace std;
const int INF = 4003;
int vis[INF];
int res[INF];
struct Node {
  int v, d, p;
} node[INF];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    long long ans = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d%d%d", &node[i].v, &node[i].d, &node[i].p);
    }
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < n; i++) {
      if (vis[i]) {
        continue;
      }
      res[ans++] = i + 1;
      queue<int> q;
      int V = node[i].v;
      for (int k = i + 1; k < n; k++) {
        if (vis[k]) {
          continue;
        }
        node[k].p -= V;
        V--;
        if (node[k].p < 0) {
          vis[k] = 1;
          q.push(k);
        }
        if (V == 0) {
          break;
        }
      }
      while (!q.empty()) {
        int tx = q.front();
        q.pop();
        for (int m = tx + 1; m < n; m++) {
          if (!vis[m]) {
            node[m].p -= node[tx].d;
            if (node[m].p < 0) {
              vis[m] = 1;
              q.push(m);
            }
          }
        }
      }
    }
    printf("%I64d\n", ans);
    for (int i = 0; i < ans; i++) {
      printf("%d%c", res[i], i == ans - 1 ? '\n' : ' ');
    }
  }
  return 0;
}
