#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5000;
int n;
long long p[MAXN], v[MAXN], d[MAXN], inque[MAXN];
vector<int> ans;
bool check(int pos) {
  int mark = -1;
  for (int i = pos; i < n; i++)
    if (inque[i] && p[i] < 0) {
      mark = i;
      break;
    }
  if (mark == -1)
    return true;
  else {
    inque[mark] = false;
    for (int i = mark + 1; i < n; i++) p[i] -= d[mark];
    return false;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d", v + i, d + i, p + i);
    inque[i] = true;
  }
  int pos = 0;
  while (pos < n) {
    while (!check(pos))
      ;
    while (!inque[pos] && pos < n) pos++;
    if (pos >= n || p[pos] < 0) break;
    int dd = v[pos];
    ans.push_back(pos);
    inque[pos] = false;
    for (int i = pos + 1; i < n && dd; i++)
      if (inque[i]) p[i] -= dd--;
    pos++;
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] + 1 << ' ';
  cout << endl;
  return 0;
}
