#include <bits/stdc++.h>
using namespace std;
int n;
const int maxn = 4444;
int v[maxn], d[maxn], p[maxn];
bool lef[maxn];
int main() {
  scanf("%d", &n);
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d", &v[i], &d[i], &p[i]);
  }
  for (int i = 0; i < n; i++) {
    if (lef[i]) continue;
    lef[i] = 1;
    ans.push_back(i + 1);
    queue<int> q;
    int cnt = v[i];
    for (int j = i + 1; j < n && cnt > 0; j++) {
      if (!lef[j]) {
        p[j] -= cnt;
        cnt--;
        if (p[j] < 0) {
          lef[j] = 1;
          q.push(j);
        }
      }
    }
    while (!q.empty()) {
      int now = q.front();
      q.pop();
      for (int i = now + 1; i < n; i++) {
        p[i] -= d[now];
        if (!lef[i] && p[i] < 0) {
          lef[i] = 1;
          q.push(i);
        }
      }
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  return 0;
}
