#include <bits/stdc++.h>
using namespace std;
int n, vis[4001], children, ans[4001];
long long v[4001], abcdefghijklmnopqrstuvwxyz[4001], d[4001];
int main() {
  while (~scanf("%d", &n)) {
    memset(vis, 0, sizeof(vis));
    children = 0;
    for (register int i = 1; i <= n; i++) {
      scanf("%lld%lld%lld", &v[i], &d[i], &abcdefghijklmnopqrstuvwxyz[i]);
    }
    for (register int i = 1; i <= n; i++) {
      if (vis[i]) {
        continue;
      }
      ans[children++] = i;
      register long long temp1 = v[i], temp2 = 0;
      for (register int j = i + 1; j <= n; j++)
        if (!vis[j]) {
          abcdefghijklmnopqrstuvwxyz[j] -= temp1;
          temp1--;
          if (temp1 < 0) {
            break;
          }
        }
      for (register int j = i + 1; j <= n; j++) {
        if (!vis[j]) {
          abcdefghijklmnopqrstuvwxyz[j] -= temp2;
        }
        if (abcdefghijklmnopqrstuvwxyz[j] < 0 && !vis[j]) {
          temp2 += d[j];
          vis[j] = 1;
        }
      }
    }
    printf("%d\n", children);
    for (register int i = 0; i < children; i++) {
      printf("%d%c", ans[i], i == children - 1 ? '\n' : ' ');
    }
  }
  return 0;
}
