#include <bits/stdc++.h>
using namespace std;
int v[5000], p[5000], d[5000], seen[5000];
int n;
void rec(int j) {
  if (seen[j]) return;
  seen[j] = 1;
  for (int i = j + 1; i < n; i++) {
    if (p[i] >= 0) {
      p[i] -= d[j];
      if (p[i] < 0) {
        rec(i);
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &v[i]);
    scanf("%d", &d[i]);
    scanf("%d", &p[i]);
  }
  int c = 0;
  vector<int> ans;
  while (c < n) {
    if (p[c] < 0) {
      c++;
    } else {
      ans.push_back(c + 1);
      for (int j = c + 1; j < n; j++)
        if (p[j] >= 0) {
          p[j] -= v[c];
          v[c]--;
          if (v[c] == 0) break;
        }
      for (int j = c + 1; j < n; j++) {
        if (p[j] < 0) {
          rec(j);
        }
      }
      c++;
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  printf("\n");
}
