#include <bits/stdc++.h>
using namespace std;
const int MaxN = 4000 + 10;
struct Data {
  int v, d;
  long long p;
} sz[MaxN];
int n;
bool go[MaxN];
void leave(int id) {
  go[id] = true;
  for (int i = id + 1; i <= n; ++i)
    if (!go[i]) sz[i].p -= sz[id].d;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d%d%I64d", &sz[i].v, &sz[i].d, &sz[i].p);
  for (int i = 1; i <= n; ++i)
    if (!go[i]) {
      int r = sz[i].v;
      for (int j = i + 1; j <= n && r > 0; ++j)
        if (!go[j]) sz[j].p -= r--;
      for (int j = i + 1; j <= n; ++j)
        if (!go[j] && sz[j].p < 0) leave(j);
    }
  int tot = 0;
  for (int i = 1; i <= n; ++i)
    if (!go[i]) ++tot;
  printf("%d\n", tot);
  for (int i = 1; i <= n; ++i)
    if (!go[i]) printf("%d ", i);
  return 0;
}
