#include <bits/stdc++.h>
using namespace std;
bool deb = false;
const int N = 100011;
int n;
long long int v[N], d[N], p[N];
bool mark[N];
int main() {
  int t;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &v[i]), scanf("%lld", &d[i]), scanf("%lld", &p[i]);
  }
  vector<int> A;
  for (int i = 0; i < n; ++i) {
    if (p[i] < 0) continue;
    if (p[i] >= 0) {
      A.push_back(i + 1);
    }
    long long int cur = v[i];
    for (int j = i + 1; j < n; ++j) {
      if (p[j] < 0) continue;
      if (cur >= 0) {
        p[j] -= cur;
        cur--;
      }
    }
    for (int j = i + 1; j < n; ++j) {
      if (p[j] >= 0 || mark[j]) continue;
      mark[j] = 1;
      for (int l = j + 1; l < n; ++l) p[l] -= d[j];
    }
  }
  printf("%d\n", (int)A.size());
  for (int i = 0; i < (int)A.size(); ++i) printf("%d ", A[i]);
  printf("\n");
  return 0;
}
