#include <bits/stdc++.h>
using namespace std;
vector<long long> vec;
long long v[4040], d[4040], p[4040], n;
bool vis[4040];
void D(int a) {
  if (vis[a]) return;
  vis[a]++;
  for (int i = a + 1; i < n; i++)
    if (p[i] >= 0)
      p[i] -= d[a];
    else
      D(i);
}
void V(int a) {
  int f = 0;
  vec.push_back(a + 1);
  for (int i = a + 1; f < v[a] && i < n; i++)
    if (p[i] >= 0)
      p[i] -= v[a] - f, f++;
    else
      D(i);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> v[i] >> d[i] >> p[i];
  for (int i = 0; i < n; i++)
    if (p[i] >= 0)
      V(i);
    else
      D(i);
  cout << vec.size() << endl;
  for (int i = 0; i < vec.size(); i++) cout << vec[i] << " ";
  cout << endl;
  return 0;
}
