#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const int maxn = 5000 + 5;
int v[maxn], d[maxn], p[maxn];
int n;
bool vis[maxn];
void row(int pos, int val, vector<int> &ve) {
  for (int i = pos + 1; i <= n; i++) {
    if (vis[i]) continue;
    p[i] -= val;
    if (p[i] < 0) {
      ve.push_back(i);
      vis[i] = true;
    }
    val--;
    if (val == 0) break;
  }
}
void bfs(vector<int> ve) {
  queue<int> que;
  for (int i = 0; i < ve.size(); i++) {
    que.push(ve[i]);
  }
  while (!que.empty()) {
    int pos = que.front();
    que.pop();
    for (int i = pos + 1; i <= n; i++) {
      if (vis[i]) continue;
      p[i] -= d[pos];
      if (p[i] < 0) {
        que.push(i);
        vis[i] = true;
      }
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d", v + i, d + i, p + i);
  }
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    if (vis[i]) continue;
    vector<int> ve;
    ans.push_back(i);
    row(i, v[i], ve);
    bfs(ve);
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  cout << endl;
  return 0;
}
