#include <bits/stdc++.h>
using namespace std;
double eps = 1e-6;
const int maxn = 4010;
const int mod = 1e9 + 7;
int n;
int v[maxn], d[maxn], c[maxn];
bool vis[maxn];
vector<int> ans;
int main() {
  memset(vis, false, sizeof(vis));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d", &v[i], &d[i], &c[i]);
  }
  for (int i = 1; i <= n; ++i) {
    if (vis[i]) continue;
    ans.push_back(i);
    queue<int> q;
    int tmp = v[i], cnt = 1;
    while (tmp) {
      if (vis[i + cnt]) {
        cnt++;
        continue;
      }
      if (i + cnt > n) break;
      c[i + cnt] -= tmp;
      if (c[i + cnt] < 0) {
        q.push(i + cnt);
        vis[i + cnt] = true;
      }
      cnt++, tmp--;
    }
    while (q.size()) {
      int cur = q.front();
      q.pop();
      for (int j = cur + 1; j <= n; ++j) {
        if (!vis[j]) {
          c[j] -= d[cur];
          if (c[j] < 0) {
            q.push(j);
            vis[j] = true;
          }
        }
      }
    }
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i];
    if (i != ans.size() - 1)
      cout << " ";
    else
      cout << endl;
  }
  return 0;
}
