#include <bits/stdc++.h>
using namespace std;
int v[4096], d[4096], p[4096], n;
vector<int> ans;
queue<int> q;
int main() {
  scanf("%d", &n);
  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 (p[i] >= 0) {
      ans.push_back(i + 1);
      for (int j = i + 1, t = v[i]; j < n && t > 0; ++j)
        if (p[j] >= 0) {
          p[j] -= t--;
          if (p[j] < 0) q.push(j);
        }
      for (int j; q.size();) {
        j = q.front();
        q.pop();
        for (int k = j + 1; k < n; ++k)
          if (p[k] >= 0) {
            p[k] -= d[j];
            if (p[k] < 0) q.push(k);
          }
      }
    }
  printf("%d\n", ans.size());
  for (int t : ans) printf("%d ", t);
}
