#include <bits/stdc++.h>
int main() {
  int n, ans;
  int v[5000], d[5000], p[5000], a[5000], vis[5000];
  scanf("%d", &n);
  ans = 0;
  memset(vis, 0, sizeof(vis));
  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 (!vis[i]) {
      a[ans++] = i + 1;
      int k = v[i];
      for (int j = i + 1; j < n && k > 0; j++)
        if (!vis[j]) {
          p[j] -= k;
          k--;
        }
      for (int j = i + 1; j < n; j++)
        if (p[j] < 0 && (!vis[j])) {
          vis[j] = 1;
          for (int k = j + 1; k < n; k++)
            if (p[k] >= 0) p[k] -= d[j];
        }
    }
  printf("%d\n", ans);
  for (int i = 0; i < ans; i++) printf("%d ", a[i]);
  printf("\n");
}
