#include <bits/stdc++.h>
using namespace std;

#define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define For(i,a,b) for(int (i) = (a); (i) < (b); ++(i))
#define rof(i,a,b) for(int (i) = (a); (i) > (b); --(i))
#define rep(i, c)  for(auto &(i) : (c))
#define x     first
#define y     second
#define ll long long
#define lli long long int
#define pb  push_back
#define PB  pop_back()
#define mp(a, b) make_pair(a, b)
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define sqr(a)  (((a) * (a)))
#define all(a)  a.begin() , a.end()
#define error(x) cerr << #x << " = " << (x) << endl
#define Error(a,b) cerr << "( " << #a << " , " << #b <<" ) = ( " << (a) << " , " << (b) << " )\n";
#define errop(a) cerr << #a << " = ( " << ((a).x) << " , " << ((a).y) << " )\n";
#define coud(a,b) cout << fixed << setprecision((b)) << (a)
#define L(x)  ((x)<<1)
#define R(x)  (((x)<<1)+1)
#define umap  unordered_map
#define max(x,y)  ((x) > (y) ? (x) : (y))
#define double long double
// INT_MAX is the max value of int

						/*debugging*/

#define out1(x)cout<<#x<<" is "<<x<<endl
#define out2(x,y)cout<<#x<<" is "<<x<<" "<<#y <<" is "<<y<<endl
#define out3(x,y,z)cout<<#x<<" is "<<x<<" "<<#y<<" is "<<y<<" "<<#z<<" is "<<z<<endl;
#define out4(a,b,c,d)cout<<#a<<" is "<<a<<" "<<#b<<"  is "<<b<<" "<<#c<<" is "<<c<<" "<<#d<<" is "<<d<<endl;
#define show(i,a,n) for(i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define sz(a) cout<<"size of "<<#a<<" is "<<a.size()
#define exectime() cout<<"execution time "<<(double)(clock() - tStart)/CLOCKS_PER_SEC<<endl;

						/*standard values*/

#define INF 1e18
#define PI 3.1415926535897932384626433832795028841971693993
#define MOD 1000000007

						/*exponentiation*/

ll inline ipow(ll a,ll b,ll m){ll val=1;a%=m;while(b){if(b&01)val=(val*a)%m;b>>=1;a=(a*a)%m;};return val%m;}
ll inline ipow(ll a,ll b){ll val=1;while(b){if(b&01)val=(val*a);b>>=1;a=(a*a);};return val;}

						/* Seive */

/*
#define LIM1 1000001
bitset<LIM1> isp;
vi primes;
inline void seive(){isp.set();isp.reset(0);isp.reset(1);for(int i=2;i*i<LIM1;i++)if(isp[i]){for(int j=i<<1;j<LIM1;j+=i)isp.reset(j);}repl(i,2,LIM1)if(isp[i]){primes.pb(i);}}
*/

						/* Totient */

/*
#define LIM4 1000001
int phi[LIM4];
void totient(){repl(i,1,LIM4)phi[i]=i;tr(primes,it)for(int i=*it;i<LIM4;i+=*it)phi[i]-=phi[i]/(*it);}
*/

						/* Inverse Modulo */

/*inline ll invmod(ll a, ll b){return (isp[b])?ipow(a,b-2,b):ipow(a,phi[b]-1,b);}*/

						/* Combinatorics */

/*
#define LIM2 1000001
ll fact[LIM2];
inline void Fact(){fact[0]=1;repl(i,1,LIM)fact[i]=(i*fact[i-1])%MOD;}
inline ll inv(ll x,ll mod){return ipow(x,mod-2,mod);}
inline ll comb(ll a, ll b){return ((fact[a]*inv(fact[b],MOD)%MOD)*inv(fact[a-b],MOD))%MOD;}
*/

int constructSegmentTree(int* arr, int* segArr, int start, int end, int pos){
	if(start == end){
		segArr[pos] = arr[start];
		return segArr[pos];
	}
	int mid = start + (end - start) / 2;
	segArr[pos] = constructSegmentTree(arr, segArr, start, mid, 2 * pos + 1) + constructSegmentTree(arr, segArr, mid + 1, end, 2 * pos + 2);
	return segArr[pos];
}

int *segmentTree(int* arr, int n){
	int x = (int)(ceil(log2(n)));
	x = 2 * pow(2, x) - 1;
	int* st = new int[x];
	constructSegmentTree(arr, st, 0, n - 1, 0);
	return st;
}

// Total overlap   - query range contains the node range(node range completely lies inside the query range)
// Partial overlap - query range partially contains the node range
// No overlap      - query range doesnt overlap the node range at all
int getSumUtil(int* st, int qstart, int qend, int sstart, int send, int pos){
	// total overlap
	if(qstart <= sstart && qend >= send)return st[pos];

	// no overlap
	if(qstart > send || qend < sstart)return 0;

	// partial overlap
	int mid = sstart + (send - sstart) / 2;
	return getSumUtil(st, qstart, qend, sstart, mid, 2 * pos + 1) + getSumUtil(st, qstart, qend, mid + 1, send, 2 * pos + 2);
}
int getSum(int* st, int n, int qstart, int qend){
	return getSumUtil(st, qstart, qend, 0, n - 1, 0);
}

void updateValueUtil(int* st, int i, int sstart, int send, int diff, int pos){
	if(i < sstart || i > send)return;
	st[pos] += diff;
	int mid = sstart + (send - sstart) / 2;
	if(sstart != send)
	{
		updateValueUtil(st, i, sstart, mid, diff, 2 * pos + 1);
		updateValueUtil(st, i, mid + 1, send, diff, 2 * pos + 2);
	}
	return;
}

void updateValue(int* arr, int* st, int n, int i, int new_val){
	int diff = new_val - arr[i];
	arr[i] = new_val;
	updateValueUtil(st, i, 0, n - 1, diff, 0);
}

int len(int n){
	int ans = 0;
	while(n){
		ans += 1&n;
		n >>= 1;
	}
	return ans;
}

long long int expo(long long int a, long long int b){
	long long int result;
	if(b == 0)return 1;

	if (b==2)
		return (a * a) % MOD;

	if (b==1)
		return a % MOD;

	if (b%2==1){
		return (a * expo(a,b-1)) % MOD;
	}
	else{
		result = expo(a,b/2) % MOD;
		return (result * result) % MOD;
	}
}

int main()
{
	lli n; cin >> n;
	lli a[n][4];
	vector<lli> ans;
	for (lli i = 0; i < n; ++i)
	{
		lli v, d, p;
		cin >> v >> d >> p;
		a[i][0] = 1;
		a[i][1] = p;
		a[i][2] = v;
		a[i][3] = d;
	}
	for(lli ind = 0; ind < n; ind++){
		if(a[ind][0] == 0)continue;
		a[ind][0] = 0; // remove from the line
		ans.push_back(ind + 1);
		lli v = a[ind][2], d = 0, i;
		for (i = ind + 1; i < n && v; ++i)
		{
			if(a[i][0]){
				a[i][1] -= v + d;
				if(a[i][1] < 0){
					d += a[i][3];
					a[i][0] = 0; // remove from the line
				}
				v--;
			}
		}
		if(d){
			for(; i < n; i++){
				a[i][1] -= d;
			}
		}
		// for (lli i = 0; i < n; ++i)
		// {
		// 	out4(a[i][0], a[i][1], a[i][2], a[i][3]);
		// }
		// cout << endl;
	}
	cout << ans.size() << endl;
	for (lli i = 0; i < ans.size(); ++i)
	{
		cout << ans[i] << " ";
	}
	cout << endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define For(i,a,b) for(int (i) = (a); (i) < (b); ++(i))
#define rof(i,a,b) for(int (i) = (a); (i) > (b); --(i))
#define rep(i, c)  for(auto &(i) : (c))
#define x     first
#define y     second
#define ll long long
#define lli long long int
#define pb  push_back
#define PB  pop_back()
#define mp(a, b) make_pair(a, b)
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define sqr(a)  (((a) * (a)))
#define all(a)  a.begin() , a.end()
#define error(x) cerr << #x << " = " << (x) << endl
#define Error(a,b) cerr << "( " << #a << " , " << #b <<" ) = ( " << (a) << " , " << (b) << " )\n";
#define errop(a) cerr << #a << " = ( " << ((a).x) << " , " << ((a).y) << " )\n";
#define coud(a,b) cout << fixed << setprecision((b)) << (a)
#define L(x)  ((x)<<1)
#define R(x)  (((x)<<1)+1)
#define umap  unordered_map
#define max(x,y)  ((x) > (y) ? (x) : (y))
#define double long double
// INT_MAX is the max value of int

						/*debugging*/

#define out1(x)cout<<#x<<" is "<<x<<endl
#define out2(x,y)cout<<#x<<" is "<<x<<" "<<#y <<" is "<<y<<endl
#define out3(x,y,z)cout<<#x<<" is "<<x<<" "<<#y<<" is "<<y<<" "<<#z<<" is "<<z<<endl;
#define out4(a,b,c,d)cout<<#a<<" is "<<a<<" "<<#b<<"  is "<<b<<" "<<#c<<" is "<<c<<" "<<#d<<" is "<<d<<endl;
#define show(i,a,n) for(i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define sz(a) cout<<"size of "<<#a<<" is "<<a.size()
#define exectime() cout<<"execution time "<<(double)(clock() - tStart)/CLOCKS_PER_SEC<<endl;

						/*standard values*/

#define INF 1e18
#define PI 3.1415926535897932384626433832795028841971693993
#define MOD 1000000007

						/*exponentiation*/

ll inline ipow(ll a,ll b,ll m){ll val=1;a%=m;while(b){if(b&01)val=(val*a)%m;b>>=1;a=(a*a)%m;};return val%m;}
ll inline ipow(ll a,ll b){ll val=1;while(b){if(b&01)val=(val*a);b>>=1;a=(a*a);};return val;}

						/* Seive */

/*
#define LIM1 1000001
bitset<LIM1> isp;
vi primes;
inline void seive(){isp.set();isp.reset(0);isp.reset(1);for(int i=2;i*i<LIM1;i++)if(isp[i]){for(int j=i<<1;j<LIM1;j+=i)isp.reset(j);}repl(i,2,LIM1)if(isp[i]){primes.pb(i);}}
*/

						/* Totient */

/*
#define LIM4 1000001
int phi[LIM4];
void totient(){repl(i,1,LIM4)phi[i]=i;tr(primes,it)for(int i=*it;i<LIM4;i+=*it)phi[i]-=phi[i]/(*it);}
*/

						/* Inverse Modulo */

/*inline ll invmod(ll a, ll b){return (isp[b])?ipow(a,b-2,b):ipow(a,phi[b]-1,b);}*/

						/* Combinatorics */

/*
#define LIM2 1000001
ll fact[LIM2];
inline void Fact(){fact[0]=1;repl(i,1,LIM)fact[i]=(i*fact[i-1])%MOD;}
inline ll inv(ll x,ll mod){return ipow(x,mod-2,mod);}
inline ll comb(ll a, ll b){return ((fact[a]*inv(fact[b],MOD)%MOD)*inv(fact[a-b],MOD))%MOD;}
*/

int constructSegmentTree(int* arr, int* segArr, int start, int end, int pos){
	if(start == end){
		segArr[pos] = arr[start];
		return segArr[pos];
	}
	int mid = start + (end - start) / 2;
	segArr[pos] = constructSegmentTree(arr, segArr, start, mid, 2 * pos + 1) + constructSegmentTree(arr, segArr, mid + 1, end, 2 * pos + 2);
	return segArr[pos];
}

int *segmentTree(int* arr, int n){
	int x = (int)(ceil(log2(n)));
	x = 2 * pow(2, x) - 1;
	int* st = new int[x];
	constructSegmentTree(arr, st, 0, n - 1, 0);
	return st;
}

// Total overlap   - query range contains the node range(node range completely lies inside the query range)
// Partial overlap - query range partially contains the node range
// No overlap      - query range doesnt overlap the node range at all
int getSumUtil(int* st, int qstart, int qend, int sstart, int send, int pos){
	// total overlap
	if(qstart <= sstart && qend >= send)return st[pos];

	// no overlap
	if(qstart > send || qend < sstart)return 0;

	// partial overlap
	int mid = sstart + (send - sstart) / 2;
	return getSumUtil(st, qstart, qend, sstart, mid, 2 * pos + 1) + getSumUtil(st, qstart, qend, mid + 1, send, 2 * pos + 2);
}
int getSum(int* st, int n, int qstart, int qend){
	return getSumUtil(st, qstart, qend, 0, n - 1, 0);
}

void updateValueUtil(int* st, int i, int sstart, int send, int diff, int pos){
	if(i < sstart || i > send)return;
	st[pos] += diff;
	int mid = sstart + (send - sstart) / 2;
	if(sstart != send)
	{
		updateValueUtil(st, i, sstart, mid, diff, 2 * pos + 1);
		updateValueUtil(st, i, mid + 1, send, diff, 2 * pos + 2);
	}
	return;
}

void updateValue(int* arr, int* st, int n, int i, int new_val){
	int diff = new_val - arr[i];
	arr[i] = new_val;
	updateValueUtil(st, i, 0, n - 1, diff, 0);
}

int len(int n){
	int ans = 0;
	while(n){
		ans += 1&n;
		n >>= 1;
	}
	return ans;
}

long long int expo(long long int a, long long int b){
	long long int result;
	if(b == 0)return 1;

	if (b==2)
		return (a * a) % MOD;

	if (b==1)
		return a % MOD;

	if (b%2==1){
		return (a * expo(a,b-1)) % MOD;
	}
	else{
		result = expo(a,b/2) % MOD;
		return (result * result) % MOD;
	}
}

int main()
{
	lli n; cin >> n;
	lli a[n][4];
	vector<lli> ans;
	for (lli i = 0; i < n; ++i)
	{
		lli v, d, p;
		cin >> v >> d >> p;
		a[i][0] = 1;
		a[i][1] = p;
		a[i][2] = v;
		a[i][3] = d;
	}
	for(lli ind = 0; ind < n; ind++){
		if(a[ind][0] == 0)continue;
		a[ind][0] = 0; // remove from the line
		ans.push_back(ind + 1);
		lli v = a[ind][2], d = 0;
		for (lli i = ind + 1; i < n && v; ++i)
		{
			if(a[i][0]){
				a[i][1] -= v;
				v--;
			}
		}
		// for (int i = 0; i < n; ++i)
		// {
		// 	if(a[i][0])cout << a[i][1] << " ";
		// }
		// cout << endl;
		for (lli i = ind + 1; i < n; ++i)
		{
			if(a[i][0]){
				if(a[i][1] < 0){
					a[i][0] = 0;
					d += a[i][3];
				}
				else{
					a[i][1] -= d;
					if(a[i][1] < 0){
						a[i][0] = 0;
						d += a[i][3];
					}
				}
			}
		}
	}
	cout << ans.size() << endl;
	for (lli i = 0; i < ans.size(); ++i)
	{
		cout << ans[i] << " ";
	}
	cout << endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define For(i,a,b) for(int (i) = (a); (i) < (b); ++(i))
#define rof(i,a,b) for(int (i) = (a); (i) > (b); --(i))
#define rep(i, c)  for(auto &(i) : (c))
#define x     first
#define y     second
#define ll long long
#define lli long long int
#define pb  push_back
#define PB  pop_back()
#define mp(a, b) make_pair(a, b)
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define sqr(a)  (((a) * (a)))
#define all(a)  a.begin() , a.end()
#define error(x) cerr << #x << " = " << (x) << endl
#define Error(a,b) cerr << "( " << #a << " , " << #b <<" ) = ( " << (a) << " , " << (b) << " )\n";
#define errop(a) cerr << #a << " = ( " << ((a).x) << " , " << ((a).y) << " )\n";
#define coud(a,b) cout << fixed << setprecision((b)) << (a)
#define L(x)  ((x)<<1)
#define R(x)  (((x)<<1)+1)
#define umap  unordered_map
#define max(x,y)  ((x) > (y) ? (x) : (y))
#define double long double
// INT_MAX is the max value of int

						/*debugging*/

#define out1(x)cout<<#x<<" is "<<x<<endl
#define out2(x,y)cout<<#x<<" is "<<x<<" "<<#y <<" is "<<y<<endl
#define out3(x,y,z)cout<<#x<<" is "<<x<<" "<<#y<<" is "<<y<<" "<<#z<<" is "<<z<<endl;
#define out4(a,b,c,d)cout<<#a<<" is "<<a<<" "<<#b<<"  is "<<b<<" "<<#c<<" is "<<c<<" "<<#d<<" is "<<d<<endl;
#define show(i,a,n) for(i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define sz(a) cout<<"size of "<<#a<<" is "<<a.size()
#define exectime() cout<<"execution time "<<(double)(clock() - tStart)/CLOCKS_PER_SEC<<endl;

						/*standard values*/

#define INF 1e18
#define PI 3.1415926535897932384626433832795028841971693993
#define MOD 1000000007

						/*exponentiation*/

ll inline ipow(ll a,ll b,ll m){ll val=1;a%=m;while(b){if(b&01)val=(val*a)%m;b>>=1;a=(a*a)%m;};return val%m;}
ll inline ipow(ll a,ll b){ll val=1;while(b){if(b&01)val=(val*a);b>>=1;a=(a*a);};return val;}

						/* Seive */

/*
#define LIM1 1000001
bitset<LIM1> isp;
vi primes;
inline void seive(){isp.set();isp.reset(0);isp.reset(1);for(int i=2;i*i<LIM1;i++)if(isp[i]){for(int j=i<<1;j<LIM1;j+=i)isp.reset(j);}repl(i,2,LIM1)if(isp[i]){primes.pb(i);}}
*/

						/* Totient */

/*
#define LIM4 1000001
int phi[LIM4];
void totient(){repl(i,1,LIM4)phi[i]=i;tr(primes,it)for(int i=*it;i<LIM4;i+=*it)phi[i]-=phi[i]/(*it);}
*/

						/* Inverse Modulo */

/*inline ll invmod(ll a, ll b){return (isp[b])?ipow(a,b-2,b):ipow(a,phi[b]-1,b);}*/

						/* Combinatorics */

/*
#define LIM2 1000001
ll fact[LIM2];
inline void Fact(){fact[0]=1;repl(i,1,LIM)fact[i]=(i*fact[i-1])%MOD;}
inline ll inv(ll x,ll mod){return ipow(x,mod-2,mod);}
inline ll comb(ll a, ll b){return ((fact[a]*inv(fact[b],MOD)%MOD)*inv(fact[a-b],MOD))%MOD;}
*/

int constructSegmentTree(int* arr, int* segArr, int start, int end, int pos){
	if(start == end){
		segArr[pos] = arr[start];
		return segArr[pos];
	}
	int mid = start + (end - start) / 2;
	segArr[pos] = constructSegmentTree(arr, segArr, start, mid, 2 * pos + 1) + constructSegmentTree(arr, segArr, mid + 1, end, 2 * pos + 2);
	return segArr[pos];
}

int *segmentTree(int* arr, int n){
	int x = (int)(ceil(log2(n)));
	x = 2 * pow(2, x) - 1;
	int* st = new int[x];
	constructSegmentTree(arr, st, 0, n - 1, 0);
	return st;
}

// Total overlap   - query range contains the node range(node range completely lies inside the query range)
// Partial overlap - query range partially contains the node range
// No overlap      - query range doesnt overlap the node range at all
int getSumUtil(int* st, int qstart, int qend, int sstart, int send, int pos){
	// total overlap
	if(qstart <= sstart && qend >= send)return st[pos];

	// no overlap
	if(qstart > send || qend < sstart)return 0;

	// partial overlap
	int mid = sstart + (send - sstart) / 2;
	return getSumUtil(st, qstart, qend, sstart, mid, 2 * pos + 1) + getSumUtil(st, qstart, qend, mid + 1, send, 2 * pos + 2);
}
int getSum(int* st, int n, int qstart, int qend){
	return getSumUtil(st, qstart, qend, 0, n - 1, 0);
}

void updateValueUtil(int* st, int i, int sstart, int send, int diff, int pos){
	if(i < sstart || i > send)return;
	st[pos] += diff;
	int mid = sstart + (send - sstart) / 2;
	if(sstart != send)
	{
		updateValueUtil(st, i, sstart, mid, diff, 2 * pos + 1);
		updateValueUtil(st, i, mid + 1, send, diff, 2 * pos + 2);
	}
	return;
}

void updateValue(int* arr, int* st, int n, int i, int new_val){
	int diff = new_val - arr[i];
	arr[i] = new_val;
	updateValueUtil(st, i, 0, n - 1, diff, 0);
}

int len(int n){
	int ans = 0;
	while(n){
		ans += 1&n;
		n >>= 1;
	}
	return ans;
}

long long int expo(long long int a, long long int b){
	long long int result;
	if(b == 0)return 1;

	if (b==2)
		return (a * a) % MOD;

	if (b==1)
		return a % MOD;

	if (b%2==1){
		return (a * expo(a,b-1)) % MOD;
	}
	else{
		result = expo(a,b/2) % MOD;
		return (result * result) % MOD;
	}
}

int main()
{
	int n; cin >> n;
	int a[n][4];
	vector<int> ans;
	set<int>s;
	for (int i = 0; i < n; ++i)
	{
		s.insert(i);
		int v, d, p;
		cin >> v >> d >> p;
		a[i][0] = 1;
		a[i][1] = p;
		a[i][2] = v;
		a[i][3] = d;
	}
	for(int ind = 0; ind < n; ind++){
		if(a[ind][0] == 0)continue;
		a[ind][0] = 0;
		ans.push_back(ind + 1);
		int v = a[ind][2], d = 0, i;
		for (i = ind + 1; i < n && v; ++i)
		{
			if(a[i][0]){
				a[i][1] -= v + d;
				if(a[i][1] < 0){
					d += a[i][3];
					a[i][0] = 0;
				}
				v--;
			}
		}
		if(d){
			for(; i < n; i++){
				a[i][1] -= d;
			}
		}
		// for (int i = 0; i < n; ++i)
		// {
		// 	out4(a[i][0], a[i][1], a[i][2], a[i][3]);
		// }
		// cout << endl;
	}
	cout << ans.size() << endl;
	for (int i = 0; i < ans.size(); ++i)
	{
		cout << ans[i] << " ";
	}
	cout << endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define For(i,a,b) for(int (i) = (a); (i) < (b); ++(i))
#define rof(i,a,b) for(int (i) = (a); (i) > (b); --(i))
#define rep(i, c)  for(auto &(i) : (c))
#define x     first
#define y     second
#define ll long long
#define lli long long int
#define pb  push_back
#define PB  pop_back()
#define mp(a, b) make_pair(a, b)
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define sqr(a)  (((a) * (a)))
#define all(a)  a.begin() , a.end()
#define error(x) cerr << #x << " = " << (x) << endl
#define Error(a,b) cerr << "( " << #a << " , " << #b <<" ) = ( " << (a) << " , " << (b) << " )\n";
#define errop(a) cerr << #a << " = ( " << ((a).x) << " , " << ((a).y) << " )\n";
#define coud(a,b) cout << fixed << setprecision((b)) << (a)
#define L(x)  ((x)<<1)
#define R(x)  (((x)<<1)+1)
#define umap  unordered_map
#define max(x,y)  ((x) > (y) ? (x) : (y))
#define double long double
// INT_MAX is the max value of int

						/*debugging*/

#define out1(x)cout<<#x<<" is "<<x<<endl
#define out2(x,y)cout<<#x<<" is "<<x<<" "<<#y <<" is "<<y<<endl
#define out3(x,y,z)cout<<#x<<" is "<<x<<" "<<#y<<" is "<<y<<" "<<#z<<" is "<<z<<endl;
#define out4(a,b,c,d)cout<<#a<<" is "<<a<<" "<<#b<<"  is "<<b<<" "<<#c<<" is "<<c<<" "<<#d<<" is "<<d<<endl;
#define show(i,a,n) for(i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define sz(a) cout<<"size of "<<#a<<" is "<<a.size()
#define exectime() cout<<"execution time "<<(double)(clock() - tStart)/CLOCKS_PER_SEC<<endl;

						/*standard values*/

#define INF 1e18
#define PI 3.1415926535897932384626433832795028841971693993
#define MOD 1000000007

						/*exponentiation*/

ll inline ipow(ll a,ll b,ll m){ll val=1;a%=m;while(b){if(b&01)val=(val*a)%m;b>>=1;a=(a*a)%m;};return val%m;}
ll inline ipow(ll a,ll b){ll val=1;while(b){if(b&01)val=(val*a);b>>=1;a=(a*a);};return val;}

						/* Seive */

/*
#define LIM1 1000001
bitset<LIM1> isp;
vi primes;
inline void seive(){isp.set();isp.reset(0);isp.reset(1);for(int i=2;i*i<LIM1;i++)if(isp[i]){for(int j=i<<1;j<LIM1;j+=i)isp.reset(j);}repl(i,2,LIM1)if(isp[i]){primes.pb(i);}}
*/

						/* Totient */

/*
#define LIM4 1000001
int phi[LIM4];
void totient(){repl(i,1,LIM4)phi[i]=i;tr(primes,it)for(int i=*it;i<LIM4;i+=*it)phi[i]-=phi[i]/(*it);}
*/

						/* Inverse Modulo */

/*inline ll invmod(ll a, ll b){return (isp[b])?ipow(a,b-2,b):ipow(a,phi[b]-1,b);}*/

						/* Combinatorics */

/*
#define LIM2 1000001
ll fact[LIM2];
inline void Fact(){fact[0]=1;repl(i,1,LIM)fact[i]=(i*fact[i-1])%MOD;}
inline ll inv(ll x,ll mod){return ipow(x,mod-2,mod);}
inline ll comb(ll a, ll b){return ((fact[a]*inv(fact[b],MOD)%MOD)*inv(fact[a-b],MOD))%MOD;}
*/

int constructSegmentTree(int* arr, int* segArr, int start, int end, int pos){
	if(start == end){
		segArr[pos] = arr[start];
		return segArr[pos];
	}
	int mid = start + (end - start) / 2;
	segArr[pos] = constructSegmentTree(arr, segArr, start, mid, 2 * pos + 1) + constructSegmentTree(arr, segArr, mid + 1, end, 2 * pos + 2);
	return segArr[pos];
}

int *segmentTree(int* arr, int n){
	int x = (int)(ceil(log2(n)));
	x = 2 * pow(2, x) - 1;
	int* st = new int[x];
	constructSegmentTree(arr, st, 0, n - 1, 0);
	return st;
}

// Total overlap   - query range contains the node range(node range completely lies inside the query range)
// Partial overlap - query range partially contains the node range
// No overlap      - query range doesnt overlap the node range at all
int getSumUtil(int* st, int qstart, int qend, int sstart, int send, int pos){
	// total overlap
	if(qstart <= sstart && qend >= send)return st[pos];

	// no overlap
	if(qstart > send || qend < sstart)return 0;

	// partial overlap
	int mid = sstart + (send - sstart) / 2;
	return getSumUtil(st, qstart, qend, sstart, mid, 2 * pos + 1) + getSumUtil(st, qstart, qend, mid + 1, send, 2 * pos + 2);
}
int getSum(int* st, int n, int qstart, int qend){
	return getSumUtil(st, qstart, qend, 0, n - 1, 0);
}

void updateValueUtil(int* st, int i, int sstart, int send, int diff, int pos){
	if(i < sstart || i > send)return;
	st[pos] += diff;
	int mid = sstart + (send - sstart) / 2;
	if(sstart != send)
	{
		updateValueUtil(st, i, sstart, mid, diff, 2 * pos + 1);
		updateValueUtil(st, i, mid + 1, send, diff, 2 * pos + 2);
	}
	return;
}

void updateValue(int* arr, int* st, int n, int i, int new_val){
	int diff = new_val - arr[i];
	arr[i] = new_val;
	updateValueUtil(st, i, 0, n - 1, diff, 0);
}

int len(int n){
	int ans = 0;
	while(n){
		ans += 1&n;
		n >>= 1;
	}
	return ans;
}

long long int expo(long long int a, long long int b){
	long long int result;
	if(b == 0)return 1;

	if (b==2)
		return (a * a) % MOD;

	if (b==1)
		return a % MOD;

	if (b%2==1){
		return (a * expo(a,b-1)) % MOD;
	}
	else{
		result = expo(a,b/2) % MOD;
		return (result * result) % MOD;
	}
}

int main()
{
	int n; cin >> n;
	int a[n][4];
	for (int i = 0; i < n; ++i)
	{
		a[i][0] = 1;
		cin >> a[i][2] >> a[i][3] >> a[i][1];
	}
	vector<int> ans;
	for (int ind = 0; ind < n; ++ind)
	{
		if(a[ind][0] == 0)continue;
		a[ind][0] = 0;
		ans.push_back(ind + 1);
		int v = a[ind][2];
		for (int i = ind + 1; i < n && v; ++i)
		{
			if(a[i][0]){
				a[i][1] -= v;
				v--;
			}
		}
		int d = 0;
		for (int i = ind + 1; i < n; ++i)
		{
			if(a[i][0] == 0)continue;
			if(a[i][1] < 0){
				a[i][0] = 0;
				d += a[i][3];
			}
			else{
				a[i][1] -= d;
				if(a[i][1] < 0){
					a[i][0] = 0;
					d += a[i][3];
				}
			}
		}
	}
	cout << ans.size() << endl;
	for (int i = 0; i < ans.size(); ++i)
	{
		cout << ans[i] << " ";
	}
	cout << endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define For(i,a,b) for(int (i) = (a); (i) < (b); ++(i))
#define rof(i,a,b) for(int (i) = (a); (i) > (b); --(i))
#define rep(i, c)  for(auto &(i) : (c))
#define x     first
#define y     second
#define ll long long
#define lli long long int
#define pb  push_back
#define PB  pop_back()
#define mp(a, b) make_pair(a, b)
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define sqr(a)  (((a) * (a)))
#define all(a)  a.begin() , a.end()
#define error(x) cerr << #x << " = " << (x) << endl
#define Error(a,b) cerr << "( " << #a << " , " << #b <<" ) = ( " << (a) << " , " << (b) << " )\n";
#define errop(a) cerr << #a << " = ( " << ((a).x) << " , " << ((a).y) << " )\n";
#define coud(a,b) cout << fixed << setprecision((b)) << (a)
#define L(x)  ((x)<<1)
#define R(x)  (((x)<<1)+1)
#define umap  unordered_map
#define max(x,y)  ((x) > (y) ? (x) : (y))
#define double long double
// INT_MAX is the max value of int

						/*debugging*/

#define out1(x)cout<<#x<<" is "<<x<<endl
#define out2(x,y)cout<<#x<<" is "<<x<<" "<<#y <<" is "<<y<<endl
#define out3(x,y,z)cout<<#x<<" is "<<x<<" "<<#y<<" is "<<y<<" "<<#z<<" is "<<z<<endl;
#define out4(a,b,c,d)cout<<#a<<" is "<<a<<" "<<#b<<"  is "<<b<<" "<<#c<<" is "<<c<<" "<<#d<<" is "<<d<<endl;
#define show(i,a,n) for(i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define sz(a) cout<<"size of "<<#a<<" is "<<a.size()
#define exectime() cout<<"execution time "<<(double)(clock() - tStart)/CLOCKS_PER_SEC<<endl;

						/*standard values*/

#define INF 1e18
#define PI 3.1415926535897932384626433832795028841971693993
#define MOD 1000000007

						/*exponentiation*/

ll inline ipow(ll a,ll b,ll m){ll val=1;a%=m;while(b){if(b&01)val=(val*a)%m;b>>=1;a=(a*a)%m;};return val%m;}
ll inline ipow(ll a,ll b){ll val=1;while(b){if(b&01)val=(val*a);b>>=1;a=(a*a);};return val;}

						/* Seive */

/*
#define LIM1 1000001
bitset<LIM1> isp;
vi primes;
inline void seive(){isp.set();isp.reset(0);isp.reset(1);for(int i=2;i*i<LIM1;i++)if(isp[i]){for(int j=i<<1;j<LIM1;j+=i)isp.reset(j);}repl(i,2,LIM1)if(isp[i]){primes.pb(i);}}
*/

						/* Totient */

/*
#define LIM4 1000001
int phi[LIM4];
void totient(){repl(i,1,LIM4)phi[i]=i;tr(primes,it)for(int i=*it;i<LIM4;i+=*it)phi[i]-=phi[i]/(*it);}
*/

						/* Inverse Modulo */

/*inline ll invmod(ll a, ll b){return (isp[b])?ipow(a,b-2,b):ipow(a,phi[b]-1,b);}*/

						/* Combinatorics */

/*
#define LIM2 1000001
ll fact[LIM2];
inline void Fact(){fact[0]=1;repl(i,1,LIM)fact[i]=(i*fact[i-1])%MOD;}
inline ll inv(ll x,ll mod){return ipow(x,mod-2,mod);}
inline ll comb(ll a, ll b){return ((fact[a]*inv(fact[b],MOD)%MOD)*inv(fact[a-b],MOD))%MOD;}
*/

int constructSegmentTree(int* arr, int* segArr, int start, int end, int pos){
	if(start == end){
		segArr[pos] = arr[start];
		return segArr[pos];
	}
	int mid = start + (end - start) / 2;
	segArr[pos] = constructSegmentTree(arr, segArr, start, mid, 2 * pos + 1) + constructSegmentTree(arr, segArr, mid + 1, end, 2 * pos + 2);
	return segArr[pos];
}

int *segmentTree(int* arr, int n){
	int x = (int)(ceil(log2(n)));
	x = 2 * pow(2, x) - 1;
	int* st = new int[x];
	constructSegmentTree(arr, st, 0, n - 1, 0);
	return st;
}

// Total overlap   - query range contains the node range(node range completely lies inside the query range)
// Partial overlap - query range partially contains the node range
// No overlap      - query range doesnt overlap the node range at all
int getSumUtil(int* st, int qstart, int qend, int sstart, int send, int pos){
	// total overlap
	if(qstart <= sstart && qend >= send)return st[pos];

	// no overlap
	if(qstart > send || qend < sstart)return 0;

	// partial overlap
	int mid = sstart + (send - sstart) / 2;
	return getSumUtil(st, qstart, qend, sstart, mid, 2 * pos + 1) + getSumUtil(st, qstart, qend, mid + 1, send, 2 * pos + 2);
}
int getSum(int* st, int n, int qstart, int qend){
	return getSumUtil(st, qstart, qend, 0, n - 1, 0);
}

void updateValueUtil(int* st, int i, int sstart, int send, int diff, int pos){
	if(i < sstart || i > send)return;
	st[pos] += diff;
	int mid = sstart + (send - sstart) / 2;
	if(sstart != send)
	{
		updateValueUtil(st, i, sstart, mid, diff, 2 * pos + 1);
		updateValueUtil(st, i, mid + 1, send, diff, 2 * pos + 2);
	}
	return;
}

void updateValue(int* arr, int* st, int n, int i, int new_val){
	int diff = new_val - arr[i];
	arr[i] = new_val;
	updateValueUtil(st, i, 0, n - 1, diff, 0);
}

int len(int n){
	int ans = 0;
	while(n){
		ans += 1&n;
		n >>= 1;
	}
	return ans;
}

long long int expo(long long int a, long long int b){
	long long int result;
	if(b == 0)return 1;

	if (b==2)
		return (a * a) % MOD;

	if (b==1)
		return a % MOD;

	if (b%2==1){
		return (a * expo(a,b-1)) % MOD;
	}
	else{
		result = expo(a,b/2) % MOD;
		return (result * result) % MOD;
	}
}

int main()
{
	lli n; cin >> n;
	lli a[n][4];
	vector<lli> ans;
	for (lli i = 0; i < n; ++i)
	{
		lli v, d, p;
		cin >> v >> d >> p;
		a[i][0] = 1;
		a[i][1] = p;
		a[i][2] = v;
		a[i][3] = d;
	}
	for(lli ind = 0; ind < n; ind++){
		if(a[ind][0] == 0)continue;
		a[ind][0] = 0; // remove from the line
		ans.push_back(ind + 1);
		lli v = a[ind][2], d = 0, i;
		for (i = ind + 1; i < n && v; ++i)
		{
			if(a[i][0]){
				a[i][1] -= v + d;
				if(a[i][1] < 0){
					d += a[i][3];
					a[i][0] = 0; // remove from the line
				}
			}
			v--;
		}
		if(d){
			for(; i < n; i++){
				a[i][1] -= d;
			}
		}
	}
	cout << ans.size() << endl;
	for (lli i = 0; i < ans.size(); ++i)
	{
		cout << ans[i] << " ";
	}
	cout << endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define For(i,a,b) for(int (i) = (a); (i) < (b); ++(i))
#define rof(i,a,b) for(int (i) = (a); (i) > (b); --(i))
#define rep(i, c)  for(auto &(i) : (c))
#define x     first
#define y     second
#define ll long long
#define lli long long int
#define pb  push_back
#define PB  pop_back()
#define mp(a, b) make_pair(a, b)
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define sqr(a)  (((a) * (a)))
#define all(a)  a.begin() , a.end()
#define error(x) cerr << #x << " = " << (x) << endl
#define Error(a,b) cerr << "( " << #a << " , " << #b <<" ) = ( " << (a) << " , " << (b) << " )\n";
#define errop(a) cerr << #a << " = ( " << ((a).x) << " , " << ((a).y) << " )\n";
#define coud(a,b) cout << fixed << setprecision((b)) << (a)
#define L(x)  ((x)<<1)
#define R(x)  (((x)<<1)+1)
#define umap  unordered_map
#define max(x,y)  ((x) > (y) ? (x) : (y))
#define double long double
// INT_MAX is the max value of int

						/*debugging*/

#define out1(x)cout<<#x<<" is "<<x<<endl
#define out2(x,y)cout<<#x<<" is "<<x<<" "<<#y <<" is "<<y<<endl
#define out3(x,y,z)cout<<#x<<" is "<<x<<" "<<#y<<" is "<<y<<" "<<#z<<" is "<<z<<endl;
#define out4(a,b,c,d)cout<<#a<<" is "<<a<<" "<<#b<<"  is "<<b<<" "<<#c<<" is "<<c<<" "<<#d<<" is "<<d<<endl;
#define show(i,a,n) for(i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define sz(a) cout<<"size of "<<#a<<" is "<<a.size()
#define exectime() cout<<"execution time "<<(double)(clock() - tStart)/CLOCKS_PER_SEC<<endl;

						/*standard values*/

#define INF 1e18
#define PI 3.1415926535897932384626433832795028841971693993
#define MOD 1000000007

						/*exponentiation*/

ll inline ipow(ll a,ll b,ll m){ll val=1;a%=m;while(b){if(b&01)val=(val*a)%m;b>>=1;a=(a*a)%m;};return val%m;}
ll inline ipow(ll a,ll b){ll val=1;while(b){if(b&01)val=(val*a);b>>=1;a=(a*a);};return val;}

						/* Seive */

/*
#define LIM1 1000001
bitset<LIM1> isp;
vi primes;
inline void seive(){isp.set();isp.reset(0);isp.reset(1);for(int i=2;i*i<LIM1;i++)if(isp[i]){for(int j=i<<1;j<LIM1;j+=i)isp.reset(j);}repl(i,2,LIM1)if(isp[i]){primes.pb(i);}}
*/

						/* Totient */

/*
#define LIM4 1000001
int phi[LIM4];
void totient(){repl(i,1,LIM4)phi[i]=i;tr(primes,it)for(int i=*it;i<LIM4;i+=*it)phi[i]-=phi[i]/(*it);}
*/

						/* Inverse Modulo */

/*inline ll invmod(ll a, ll b){return (isp[b])?ipow(a,b-2,b):ipow(a,phi[b]-1,b);}*/

						/* Combinatorics */

/*
#define LIM2 1000001
ll fact[LIM2];
inline void Fact(){fact[0]=1;repl(i,1,LIM)fact[i]=(i*fact[i-1])%MOD;}
inline ll inv(ll x,ll mod){return ipow(x,mod-2,mod);}
inline ll comb(ll a, ll b){return ((fact[a]*inv(fact[b],MOD)%MOD)*inv(fact[a-b],MOD))%MOD;}
*/

int constructSegmentTree(int* arr, int* segArr, int start, int end, int pos){
	if(start == end){
		segArr[pos] = arr[start];
		return segArr[pos];
	}
	int mid = start + (end - start) / 2;
	segArr[pos] = constructSegmentTree(arr, segArr, start, mid, 2 * pos + 1) + constructSegmentTree(arr, segArr, mid + 1, end, 2 * pos + 2);
	return segArr[pos];
}

int *segmentTree(int* arr, int n){
	int x = (int)(ceil(log2(n)));
	x = 2 * pow(2, x) - 1;
	int* st = new int[x];
	constructSegmentTree(arr, st, 0, n - 1, 0);
	return st;
}

// Total overlap   - query range contains the node range(node range completely lies inside the query range)
// Partial overlap - query range partially contains the node range
// No overlap      - query range doesnt overlap the node range at all
int getSumUtil(int* st, int qstart, int qend, int sstart, int send, int pos){
	// total overlap
	if(qstart <= sstart && qend >= send)return st[pos];

	// no overlap
	if(qstart > send || qend < sstart)return 0;

	// partial overlap
	int mid = sstart + (send - sstart) / 2;
	return getSumUtil(st, qstart, qend, sstart, mid, 2 * pos + 1) + getSumUtil(st, qstart, qend, mid + 1, send, 2 * pos + 2);
}
int getSum(int* st, int n, int qstart, int qend){
	return getSumUtil(st, qstart, qend, 0, n - 1, 0);
}

void updateValueUtil(int* st, int i, int sstart, int send, int diff, int pos){
	if(i < sstart || i > send)return;
	st[pos] += diff;
	int mid = sstart + (send - sstart) / 2;
	if(sstart != send)
	{
		updateValueUtil(st, i, sstart, mid, diff, 2 * pos + 1);
		updateValueUtil(st, i, mid + 1, send, diff, 2 * pos + 2);
	}
	return;
}

void updateValue(int* arr, int* st, int n, int i, int new_val){
	int diff = new_val - arr[i];
	arr[i] = new_val;
	updateValueUtil(st, i, 0, n - 1, diff, 0);
}

int len(int n){
	int ans = 0;
	while(n){
		ans += 1&n;
		n >>= 1;
	}
	return ans;
}

long long int expo(long long int a, long long int b){
	long long int result;
	if(b == 0)return 1;

	if (b==2)
		return (a * a) % MOD;

	if (b==1)
		return a % MOD;

	if (b%2==1){
		return (a * expo(a,b-1)) % MOD;
	}
	else{
		result = expo(a,b/2) % MOD;
		return (result * result) % MOD;
	}
}

int main()
{
	lli n; cin >> n;
	lli a[n][4];
	vector<lli> ans;
	for (lli i = 0; i < n; ++i)
	{
		lli v, d, p;
		cin >> v >> d >> p;
		a[i][0] = 1;
		a[i][1] = p;
		a[i][2] = v;
		a[i][3] = d;
	}
	for(lli ind = 0; ind < n; ind++){
		if(a[ind][0] == 0)continue;
		a[ind][0] = 0; // remove from the line
		ans.push_back(ind + 1);
		lli v = a[ind][2], d = 0;
		for (lli i = ind + 1; i < n && v; ++i)
		{
			if(a[i][0]){
				a[i][1] -= v;
			}
			v--;
		}
		for (lli i = ind + 1; i < n; ++i)
		{
			if(a[i][0]){
				if(a[i][1] < 0){
					a[i][0] = 0;
					d += a[i][3];
				}
				else{
					a[i][1] -= d;
					if(a[i][1] < 0){
						a[i][0] = 0;
						d += a[i][3];
					}
				}
			}
		}
		// for (int i = 0; i < n; ++i)
		// {
		// 	if(a[i][0])cout << a[i][1] << " ";
		// }
		// cout << endl;
	}
	cout << ans.size() << endl;
	for (lli i = 0; i < ans.size(); ++i)
	{
		cout << ans[i] << " ";
	}
	cout << endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define For(i,a,b) for(int (i) = (a); (i) < (b); ++(i))
#define rof(i,a,b) for(int (i) = (a); (i) > (b); --(i))
#define rep(i, c)  for(auto &(i) : (c))
#define x     first
#define y     second
#define ll long long
#define lli long long int
#define pb  push_back
#define PB  pop_back()
#define mp(a, b) make_pair(a, b)
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define sqr(a)  (((a) * (a)))
#define all(a)  a.begin() , a.end()
#define error(x) cerr << #x << " = " << (x) << endl
#define Error(a,b) cerr << "( " << #a << " , " << #b <<" ) = ( " << (a) << " , " << (b) << " )\n";
#define errop(a) cerr << #a << " = ( " << ((a).x) << " , " << ((a).y) << " )\n";
#define coud(a,b) cout << fixed << setprecision((b)) << (a)
#define L(x)  ((x)<<1)
#define R(x)  (((x)<<1)+1)
#define umap  unordered_map
#define max(x,y)  ((x) > (y) ? (x) : (y))
#define double long double
// INT_MAX is the max value of int

						/*debugging*/

#define out1(x)cout<<#x<<" is "<<x<<endl
#define out2(x,y)cout<<#x<<" is "<<x<<" "<<#y <<" is "<<y<<endl
#define out3(x,y,z)cout<<#x<<" is "<<x<<" "<<#y<<" is "<<y<<" "<<#z<<" is "<<z<<endl;
#define out4(a,b,c,d)cout<<#a<<" is "<<a<<" "<<#b<<"  is "<<b<<" "<<#c<<" is "<<c<<" "<<#d<<" is "<<d<<endl;
#define show(i,a,n) for(i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define sz(a) cout<<"size of "<<#a<<" is "<<a.size()
#define exectime() cout<<"execution time "<<(double)(clock() - tStart)/CLOCKS_PER_SEC<<endl;

						/*standard values*/

#define INF 1e18
#define PI 3.1415926535897932384626433832795028841971693993
#define MOD 1000000007

						/*exponentiation*/

ll inline ipow(ll a,ll b,ll m){ll val=1;a%=m;while(b){if(b&01)val=(val*a)%m;b>>=1;a=(a*a)%m;};return val%m;}
ll inline ipow(ll a,ll b){ll val=1;while(b){if(b&01)val=(val*a);b>>=1;a=(a*a);};return val;}

						/* Seive */

/*
#define LIM1 1000001
bitset<LIM1> isp;
vi primes;
inline void seive(){isp.set();isp.reset(0);isp.reset(1);for(int i=2;i*i<LIM1;i++)if(isp[i]){for(int j=i<<1;j<LIM1;j+=i)isp.reset(j);}repl(i,2,LIM1)if(isp[i]){primes.pb(i);}}
*/

						/* Totient */

/*
#define LIM4 1000001
int phi[LIM4];
void totient(){repl(i,1,LIM4)phi[i]=i;tr(primes,it)for(int i=*it;i<LIM4;i+=*it)phi[i]-=phi[i]/(*it);}
*/

						/* Inverse Modulo */

/*inline ll invmod(ll a, ll b){return (isp[b])?ipow(a,b-2,b):ipow(a,phi[b]-1,b);}*/

						/* Combinatorics */

/*
#define LIM2 1000001
ll fact[LIM2];
inline void Fact(){fact[0]=1;repl(i,1,LIM)fact[i]=(i*fact[i-1])%MOD;}
inline ll inv(ll x,ll mod){return ipow(x,mod-2,mod);}
inline ll comb(ll a, ll b){return ((fact[a]*inv(fact[b],MOD)%MOD)*inv(fact[a-b],MOD))%MOD;}
*/

int constructSegmentTree(int* arr, int* segArr, int start, int end, int pos){
	if(start == end){
		segArr[pos] = arr[start];
		return segArr[pos];
	}
	int mid = start + (end - start) / 2;
	segArr[pos] = constructSegmentTree(arr, segArr, start, mid, 2 * pos + 1) + constructSegmentTree(arr, segArr, mid + 1, end, 2 * pos + 2);
	return segArr[pos];
}

int *segmentTree(int* arr, int n){
	int x = (int)(ceil(log2(n)));
	x = 2 * pow(2, x) - 1;
	int* st = new int[x];
	constructSegmentTree(arr, st, 0, n - 1, 0);
	return st;
}

// Total overlap   - query range contains the node range(node range completely lies inside the query range)
// Partial overlap - query range partially contains the node range
// No overlap      - query range doesnt overlap the node range at all
int getSumUtil(int* st, int qstart, int qend, int sstart, int send, int pos){
	// total overlap
	if(qstart <= sstart && qend >= send)return st[pos];

	// no overlap
	if(qstart > send || qend < sstart)return 0;

	// partial overlap
	int mid = sstart + (send - sstart) / 2;
	return getSumUtil(st, qstart, qend, sstart, mid, 2 * pos + 1) + getSumUtil(st, qstart, qend, mid + 1, send, 2 * pos + 2);
}
int getSum(int* st, int n, int qstart, int qend){
	return getSumUtil(st, qstart, qend, 0, n - 1, 0);
}

void updateValueUtil(int* st, int i, int sstart, int send, int diff, int pos){
	if(i < sstart || i > send)return;
	st[pos] += diff;
	int mid = sstart + (send - sstart) / 2;
	if(sstart != send)
	{
		updateValueUtil(st, i, sstart, mid, diff, 2 * pos + 1);
		updateValueUtil(st, i, mid + 1, send, diff, 2 * pos + 2);
	}
	return;
}

void updateValue(int* arr, int* st, int n, int i, int new_val){
	int diff = new_val - arr[i];
	arr[i] = new_val;
	updateValueUtil(st, i, 0, n - 1, diff, 0);
}

int len(int n){
	int ans = 0;
	while(n){
		ans += 1&n;
		n >>= 1;
	}
	return ans;
}

long long int expo(long long int a, long long int b){
	long long int result;
	if(b == 0)return 1;

	if (b==2)
		return (a * a) % MOD;

	if (b==1)
		return a % MOD;

	if (b%2==1){
		return (a * expo(a,b-1)) % MOD;
	}
	else{
		result = expo(a,b/2) % MOD;
		return (result * result) % MOD;
	}
}

int main()
{
	lli n; cin >> n;
	lli a[n][4];
	vector<lli> ans;
	for (lli i = 0; i < n; ++i)
	{
		lli v, d, p;
		cin >> v >> d >> p;
		a[i][0] = 1;
		a[i][1] = p;
		a[i][2] = v;
		a[i][3] = d;
	}
	for(lli ind = 0; ind < n; ind++){
		if(a[ind][0] == 0)continue;
		a[ind][0] = 0; // remove from the line
		ans.push_back(ind + 1);
		lli v = a[ind][2], d = 0, i;
		for (i = ind + 1; i < n && v; ++i)
		{
			if(a[i][0]){
				a[i][1] -= v;
				if(a[i][1] < 0){
					d += a[i][3];
					a[i][0] = 0; // remove from the line
				}
				a[i][1] -= d;
			}
			v--;
		}
		if(d){
			for(; i < n; i++){
				a[i][1] -= d;
			}
		}
	}
	cout << ans.size() << endl;
	for (lli i = 0; i < ans.size(); ++i)
	{
		cout << ans[i] << " ";
	}
	cout << endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define For(i,a,b) for(int (i) = (a); (i) < (b); ++(i))
#define rof(i,a,b) for(int (i) = (a); (i) > (b); --(i))
#define rep(i, c)  for(auto &(i) : (c))
#define x     first
#define y     second
#define ll long long
#define lli long long int
#define pb  push_back
#define PB  pop_back()
#define mp(a, b) make_pair(a, b)
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define sqr(a)  (((a) * (a)))
#define all(a)  a.begin() , a.end()
#define error(x) cerr << #x << " = " << (x) << endl
#define Error(a,b) cerr << "( " << #a << " , " << #b <<" ) = ( " << (a) << " , " << (b) << " )\n";
#define errop(a) cerr << #a << " = ( " << ((a).x) << " , " << ((a).y) << " )\n";
#define coud(a,b) cout << fixed << setprecision((b)) << (a)
#define L(x)  ((x)<<1)
#define R(x)  (((x)<<1)+1)
#define umap  unordered_map
#define max(x,y)  ((x) > (y) ? (x) : (y))
#define double long double
// INT_MAX is the max value of int

						/*debugging*/

#define out1(x)cout<<#x<<" is "<<x<<endl
#define out2(x,y)cout<<#x<<" is "<<x<<" "<<#y <<" is "<<y<<endl
#define out3(x,y,z)cout<<#x<<" is "<<x<<" "<<#y<<" is "<<y<<" "<<#z<<" is "<<z<<endl;
#define out4(a,b,c,d)cout<<#a<<" is "<<a<<" "<<#b<<"  is "<<b<<" "<<#c<<" is "<<c<<" "<<#d<<" is "<<d<<endl;
#define show(i,a,n) for(i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define sz(a) cout<<"size of "<<#a<<" is "<<a.size()
#define exectime() cout<<"execution time "<<(double)(clock() - tStart)/CLOCKS_PER_SEC<<endl;

						/*standard values*/

#define INF 1e18
#define PI 3.1415926535897932384626433832795028841971693993
#define MOD 1000000007

						/*exponentiation*/

ll inline ipow(ll a,ll b,ll m){ll val=1;a%=m;while(b){if(b&01)val=(val*a)%m;b>>=1;a=(a*a)%m;};return val%m;}
ll inline ipow(ll a,ll b){ll val=1;while(b){if(b&01)val=(val*a);b>>=1;a=(a*a);};return val;}

						/* Seive */

/*
#define LIM1 1000001
bitset<LIM1> isp;
vi primes;
inline void seive(){isp.set();isp.reset(0);isp.reset(1);for(int i=2;i*i<LIM1;i++)if(isp[i]){for(int j=i<<1;j<LIM1;j+=i)isp.reset(j);}repl(i,2,LIM1)if(isp[i]){primes.pb(i);}}
*/

						/* Totient */

/*
#define LIM4 1000001
int phi[LIM4];
void totient(){repl(i,1,LIM4)phi[i]=i;tr(primes,it)for(int i=*it;i<LIM4;i+=*it)phi[i]-=phi[i]/(*it);}
*/

						/* Inverse Modulo */

/*inline ll invmod(ll a, ll b){return (isp[b])?ipow(a,b-2,b):ipow(a,phi[b]-1,b);}*/

						/* Combinatorics */

/*
#define LIM2 1000001
ll fact[LIM2];
inline void Fact(){fact[0]=1;repl(i,1,LIM)fact[i]=(i*fact[i-1])%MOD;}
inline ll inv(ll x,ll mod){return ipow(x,mod-2,mod);}
inline ll comb(ll a, ll b){return ((fact[a]*inv(fact[b],MOD)%MOD)*inv(fact[a-b],MOD))%MOD;}
*/

int constructSegmentTree(int* arr, int* segArr, int start, int end, int pos){
	if(start == end){
		segArr[pos] = arr[start];
		return segArr[pos];
	}
	int mid = start + (end - start) / 2;
	segArr[pos] = constructSegmentTree(arr, segArr, start, mid, 2 * pos + 1) + constructSegmentTree(arr, segArr, mid + 1, end, 2 * pos + 2);
	return segArr[pos];
}

int *segmentTree(int* arr, int n){
	int x = (int)(ceil(log2(n)));
	x = 2 * pow(2, x) - 1;
	int* st = new int[x];
	constructSegmentTree(arr, st, 0, n - 1, 0);
	return st;
}

// Total overlap   - query range contains the node range(node range completely lies inside the query range)
// Partial overlap - query range partially contains the node range
// No overlap      - query range doesnt overlap the node range at all
int getSumUtil(int* st, int qstart, int qend, int sstart, int send, int pos){
	// total overlap
	if(qstart <= sstart && qend >= send)return st[pos];

	// no overlap
	if(qstart > send || qend < sstart)return 0;

	// partial overlap
	int mid = sstart + (send - sstart) / 2;
	return getSumUtil(st, qstart, qend, sstart, mid, 2 * pos + 1) + getSumUtil(st, qstart, qend, mid + 1, send, 2 * pos + 2);
}
int getSum(int* st, int n, int qstart, int qend){
	return getSumUtil(st, qstart, qend, 0, n - 1, 0);
}

void updateValueUtil(int* st, int i, int sstart, int send, int diff, int pos){
	if(i < sstart || i > send)return;
	st[pos] += diff;
	int mid = sstart + (send - sstart) / 2;
	if(sstart != send)
	{
		updateValueUtil(st, i, sstart, mid, diff, 2 * pos + 1);
		updateValueUtil(st, i, mid + 1, send, diff, 2 * pos + 2);
	}
	return;
}

void updateValue(int* arr, int* st, int n, int i, int new_val){
	int diff = new_val - arr[i];
	arr[i] = new_val;
	updateValueUtil(st, i, 0, n - 1, diff, 0);
}

int len(int n){
	int ans = 0;
	while(n){
		ans += 1&n;
		n >>= 1;
	}
	return ans;
}

long long int expo(long long int a, long long int b){
	long long int result;
	if(b == 0)return 1;

	if (b==2)
		return (a * a) % MOD;

	if (b==1)
		return a % MOD;

	if (b%2==1){
		return (a * expo(a,b-1)) % MOD;
	}
	else{
		result = expo(a,b/2) % MOD;
		return (result * result) % MOD;
	}
}

int main()
{
	lli n; cin >> n;
	lli a[n][4];
	vector<lli> ans;
	for (lli i = 0; i < n; ++i)
	{
		lli v, d, p;
		cin >> v >> d >> p;
		a[i][0] = 1;
		a[i][1] = p;
		a[i][2] = v;
		a[i][3] = d;
	}
	for(lli ind = 0; ind < n; ind++){
		if(a[ind][0] == 0)continue;
		a[ind][0] = 0; // remove from the line
		ans.push_back(ind + 1);
		lli v = a[ind][2], d = 0;
		for (lli i = ind + 1; i < n && v; ++i)
		{
			a[i][1] -= v;
			v--;
		}
		for (lli i = ind + 1; i < n; ++i)
		{
			if(a[i][0]){
				if(a[i][1] < 0){
					a[i][0] = 0;
					d += a[i][3];
				}
				else{
					a[i][1] -= d;
					if(a[i][1] < 0){
						a[i][0] = 0;
						d += a[i][3];
					}
				}
			}
		}
		// for (int i = 0; i < n; ++i)
		// {
		// 	if(a[i][0])cout << a[i][1] << " ";
		// }
		// cout << endl;
	}
	cout << ans.size() << endl;
	for (lli i = 0; i < ans.size(); ++i)
	{
		cout << ans[i] << " ";
	}
	cout << endl;

	return 0;
}


#include <stdio.h>

const int maxn = 4096;
int v[maxn], d[maxn], p[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    for(int i=0; i<n; i++){
        for(; i<n; i++) if(p[i]>=0) break;
        if(i == n)  break;
        ans[k++] = i;

        for(int m=1; m<v[i] && m+i<n; m++)
            p[i+m] -= v[i] - m - 1;
        int tmp = 0;
        for(int m=i+1; m<n; m++){
            p[m] -= tmp;
            if(p[m] < 0)    tmp += d[m];
        }
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <stdio.h>

const int maxn = 4096;
int v[maxn], d[maxn], p[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    for(int i=0; i<n; i++){
        for(; i<n; i++) if(p[i]>=0) break;
        if(i == n)  break;
        ans[k++] = i;

        for(int m=1; m<v[i] && m+i<n; m++)
            p[i+m] -= v[i] - m;
        int tmp = 0;
        for(int m=i+1; m<n; m++){
            p[m] -= tmp;
            if(p[m] < 0)    tmp += d[m];
        }
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    printf("\n");
    return 0;
}


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <queue>
using namespace std;

const int maxn = 4096;
int v[maxn], d[maxn], p[maxn];
bool flag[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    memset(flag,0,sizeof(flag));
    for(int i=0; i<n; i++){
        if(p[i] < 0)    continue;
        ans[k++] = i;
        queue<int> q;
        for(int j=i+1,m=v[i]; j<n&&m>0;j++){
            if(!flag[j]){
                p[j] -= m;
                m--;
                if(p[j] < 0){
                    q.push(j);
                    flag[j] = true;
                }
            }
        }
        while(!q.empty()){
            int cur = q.front(); q.pop();
            for(int j=cur+1; j<n; j++){
                if(!flag[j]){
                    p[j] -= d[cur];
                    if(p[j] < 0){
                        flag[j] = true;
                        q.push(j);
                    }
                }
            }
        }
        /*int tmp = 0;
        for(int j=i+1; j<n; j++){
            if(!flag[j]){
                p[j] -= tmp;
                if(p[j] < 0){
                    flag[j] = true;
                    tmp += d[j];
                }
            }
        }*/
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <stdio.h>

const int maxn = 4096;
int v[maxn], d[maxn], p[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    for(int i=0; i<n; i++){
        for(; i<n; i++) if(p[i]>=0) break;
        if(i == n)  break;
        ans[k++] = i;

        for(int m=1; m<=v[i] && m+i<n; m++)
            p[i+m] -= v[i] - m + 1;
        int tmp = 0;
        for(int m=i+1; m<n; m++){
            p[m] -= tmp;
            if(p[m] < 0)    tmp += d[m];
        }
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <queue>
using namespace std;

const int maxn = 4096;
int v[maxn], d[maxn], p[maxn];
bool flag[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%I64d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    memset(flag,0,sizeof(flag));
    for(int i=0; i<n; i++){
        if(p[i] < 0)    continue;
        ans[k++] = i;
        /*queue<int> q;
        for(int j=i+1,m=v[i]; j<n&&m>0;j++){
            if(!flag[j]){
                p[j] -= m;
                m--;
                if(p[j] < 0){
                    q.push(j);
                    flag[j] = true;
                }
            }
        }
        while(!q.empty()){
            int cur = q.front(); q.pop();
            for(int j=cur+1; j<n; j++){
                if(!flag[j]){
                    p[j] -= d[cur];
                    if(p[j] < 0){
                        flag[j] = true;
                        q.push(j);
                    }
                }
            }
        }*/
        for(int j=i+1,m=v[i]; j<n&&m>=0;j++){
            if(!flag[j]){
                p[j] -= m;
                m--;
            }
        }
        long long tmp = 0;
        for(int j=i+1; j<n; j++){
            if(!flag[j]){
                p[j] -= tmp;
                if(p[j] < 0){
                    flag[j] = true;
                    tmp += d[j];
                }
            }
        }
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <stdio.h>
#include <string.h>

const int maxn = 4096;
int v[maxn], d[maxn];
long long p[maxn];
bool flag[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%%I64d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    memset(flag,0,sizeof(flag));
    for(int i=0; i<n; i++){
        if(p[i] < 0)    continue;
        ans[k++] = i;

        for(int j=i+1,m=v[i]; j<n&&m>0;j++){
            if(!flag[j]){
                p[j] -= m;
                m--;
            }
        }

        long long tmp = 0;
        for(int j=i+1; j<n; j++){
            if(!flag[j]){
                p[j] -= tmp;
                if(p[j] < 0){
                    flag[j] = true;
                    tmp += d[j];
                }
            }
        }
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <stdio.h>
#include <string.h>

const int maxn = 4096;
int v[maxn], d[maxn], p[maxn];
bool flag[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    memset(flag,0,sizeof(flag));
    for(int i=0; i<n; i++){
        if(p[i] < 0)    continue;
        ans[k++] = i;

        for(int j=i+1,m=v[i]; j<n&&m>0;j++){
            if(!flag[j]){
                p[j] -= m;
                m--;
            }
        }

        int tmp = 0;
        for(int m=i+1; m<n; m++){
            if(!flag[m]){
                p[m] -= tmp;
                if(p[m] < 0){
                    tmp += d[m];
                    flag[m] = true;
                }
            }
        }
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <queue>
using namespace std;

const int maxn = 4096;
int v[maxn], d[maxn];
long long p[maxn];
bool flag[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%I64d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    memset(flag,0,sizeof(flag));
    for(int i=0; i<n; i++){
        if(p[i] < 0)    continue;
        ans[k++] = i;
        /*queue<int> q;
        for(int j=i+1,m=v[i]; j<n&&m>0;j++){
            if(!flag[j]){
                p[j] -= m;
                m--;
                if(p[j] < 0){
                    q.push(j);
                    flag[j] = true;
                }
            }
        }
        while(!q.empty()){
            int cur = q.front(); q.pop();
            for(int j=cur+1; j<n; j++){
                if(!flag[j]){
                    p[j] -= d[cur];
                    if(p[j] < 0){
                        flag[j] = true;
                        q.push(j);
                    }
                }
            }
        }*/
        for(int j=i+1,m=v[i]; j<n&&m>=0;j++){
            if(!flag[j]){
                p[j] -= m;
                m--;
            }
        }
        long long tmp = 0;
        for(int j=i+1; j<n; j++){
            if(!flag[j]){
                p[j] -= tmp;
                if(p[j] < 0){
                    flag[j] = true;
                    tmp += d[j];
                }
            }
        }
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <queue>
using namespace std;

const int maxn = 4096;
int v[maxn], d[maxn], p[maxn];
bool flag[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    memset(flag,0,sizeof(flag));
    for(int i=0; i<n; i++){
        if(p[i] < 0)    continue;
        ans[k++] = i;
        queue<int> q;
        for(int j=i+1,m=v[i]; j<n&&m>0;j++){
            if(!flag[j]){
                p[j] -= m;
                m--;
                if(p[j] < 0){
                    q.push(j);
                    flag[j] = true;
                }
            }
        }
        while(!q.empty()){
            int cur = q.front(); q.pop();
            for(int j=cur+1; j<n; j++){
                if(!flag[j]){
                    p[j] -= d[i];
                    if(p[j] < 0){
                        flag[j] = true;
                        q.push(j);
                    }
                }
            }
        }
        /*int tmp = 0;
        for(int j=i+1; j<n; j++){
            if(!flag[j]){
                p[j] -= tmp;
                if(p[j] < 0){
                    flag[j] = true;
                    tmp += d[j];
                }
            }
        }*/
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <stdio.h>
#include <string.h>

const int maxn = 4096;
int v[maxn], d[maxn], p[maxn];
bool flag[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    memset(flag,0,sizeof(flag));
    for(int i=0; i<n; i++){
        if(p[i] < 0)    continue;
        ans[k++] = i;

        for(int j=i+1,m=v[i]; j<n&&m>0;j++){
            if(!flag[j]){
                p[j] -= m;
                m--;
            }
        }

        int tmp = 0;
        for(int j=i+1; j<n; j++){
            if(!flag[j]){
                p[j] -= tmp;
                if(p[j] < 0){
                    flag[j] = true;
                    tmp += d[j];
                }
            }
        }
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <stdio.h>

const int maxn = 4096;
int v[maxn], d[maxn], p[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    for(int i=0; i<n; i++){
        for(; i<n; i++) if(p[i]>=0) break;
        if(i == n)  break;
        ans[k++] = i;

        for(int m=1; m<v[i] && m+i<n; m++)
            p[i+m] -= v[i] - m;
        //int tmp = 0;
        for(int m=i+1; m<n; m++){
            if(p[m] < 0){
                for(int l=m+1; l<n; l++)
                    p[l] -= d[m];
            }
        }
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <stdio.h>
#include <string.h>

const int maxn = 4096;
int v[maxn], d[maxn], p[maxn];
bool flag[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    memset(flag,0,sizeof(flag));
    for(int i=0; i<n; i++){
        for(; i<n; i++) if(p[i]>=0) break;
        if(i == n)  break;
        ans[k++] = i;

        for(int j=i+1,m=v[i]; j<n&&m>=0;j++){
            if(!flag[m]){
                p[j] -= m;
                m--;
            }
        }

        int tmp = 0;
        for(int m=i+1; m<n; m++){
            if(!flag[m]){
                p[m] -= tmp;
                if(p[m] < 0){
                    tmp += d[m];
                    flag[m] = true;
                }
            }
        }
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <stdio.h>
#include <string.h>

const int maxn = 4096;
int v[maxn], d[maxn], p[maxn];
bool flag[maxn];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d%d%d",&v[i],&d[i],&p[i]);

    int ans[n];
    int k=0;
    memset(flag,0,sizeof(flag));
    for(int i=0; i<n; i++){
        for(; i<n; i++) if(p[i]>=0) break;
        if(i == n)  break;
        ans[k++] = i;

        for(int m=1; m<=v[i] && m+i<n; m++){
            p[i+m] -= v[i] - m + 1;
        }

        int tmp = 0;
        for(int m=i+1; m<n; m++){
            if(!flag[m]){
                p[m] -= tmp;
                if(p[m] < 0){
                    tmp += d[m];
                    flag[m] = true;
                }
            }
        }
    }
    printf("%d\n",k);
    for(int i=0; i<k; i++){
        if(i > 0)
            printf(" ");
        printf("%d",ans[i]+1);
    }
    return 0;
}


#include <iostream>

using namespace std;
struct bola
{
	int xonadabaqiradi, koridordabaqiradi, bardoshi;
};
int main()
{
	bola t[100001];
	int n, g = 0, b[4001], c = 0, d;
	cin >> n;
	for (int i = 1 ; i <= n ; i++)
	{
		cin >> t[i].xonadabaqiradi >> t[i].koridordabaqiradi >> t[i].bardoshi;
	}
	for (int i = 2 ; i <= n ; i++)
	{
		if (t[i].bardoshi >= 0)
		{
			if (t[i-1].bardoshi > -1)
			{
				d = t[i-1].xonadabaqiradi;
				int j = i;
				while (d > 0)
				{
					if (t[j].bardoshi > -1)
					{
						t[j].bardoshi -= d;
					}
					if (j == n)
					break;
					d--;
					j++;
				}
			}
			else
			{
				i++;
				d = t[i-1].xonadabaqiradi;
				int j = i;
				while (d > 0)
				{
					if (t[j].bardoshi > -1)
					{
						t[j].bardoshi -= d;
						if (t[j].bardoshi < 0)
						{
							int e = i+1;
							while ( e <= n )
							{
								t[e].bardoshi -= t[j].koridordabaqiradi;
								e++;
							}
						}
					}
					if (j == n)
					break;
					d--;
					j++;
				}
			}
		}
		if (t[i].bardoshi < 0)
		{
			int e = i+1;
			while ( e <= n )
			{
				t[e].bardoshi -= t[i].koridordabaqiradi;
				e++;
			}
		}
	}
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].bardoshi > -1)
		{
			g++;
			b[c++] = i;
		}
	}
	cout << g << endl;
	for (int i = 0 ; i < c ; i++)
	{
		cout << b[i] << " ";
	}
}


#include <iostream>

using namespace std;
struct bola
{
	int xonadabaqiradi, koridordabaqiradi, bardoshi;
};
int main()
{
	bola t[100001];
	int n, g = 0, b[4001], c = 0, d;
	cin >> n;
	for (int i = 1 ; i <= n ; i++)
	{
		cin >> t[i].xonadabaqiradi >> t[i].koridordabaqiradi >> t[i].bardoshi;
	}
	for (int i = 2 ; i <= n ; i++)
	{
		if (t[i].bardoshi >= 0)
		{
			if (t[i-1].bardoshi > -1)
			{
				d = t[i-1].xonadabaqiradi;
				int j = i;
				while (d > 0)
				{
					if (t[j].bardoshi > -1)
					{
						t[j].bardoshi -= d;
					}
					if (j == n)
					break;
					d--;
					j++;
				}
			}
		}
		if (t[i].bardoshi < 0)
		{
			int e = i+1;
			while ( e <= n )
			{
				t[e].bardoshi -= t[i].koridordabaqiradi;
				e++;
			}
		}
	}
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].bardoshi > -1)
		{
			g++;
			b[c++] = i;
		}
	}
	cout << g << endl;
	for (int i = 0 ; i < c ; i++)
	{
		cout << b[i] << " ";
	}
}


#include <iostream>
#include <vector>

using namespace std;
struct bola
{
    int xonadabaqiradi, yuguribbaqiradi, bardoshi, qochdi = 0;
    bool z = true;
} t[1000001];
int n, b[400001], x, ayir;
int main()
{
    bool s = false;
    cin >> n;
    for (int i = 1 ; i <= n ; i++)
    {
        cin >> t[i].xonadabaqiradi >> t[i].yuguribbaqiradi >> t[i].bardoshi;
    }
    int i = 0;
    for (int i = 1 ; i <= n ; i++)
    {
        if (t[i].qochdi == 0)
        {
            int d = t[i].xonadabaqiradi;
            int j = 0; j = i + 1;
            x = i+1;
            while (d > 0)
            {
                if (t[j].z && t[i].qochdi == 0)
                {
                    t[j].bardoshi -= d;
                    if (t[j].bardoshi < 0)
                    {
                        t[j].z = false;
                        s = true;
                    }
                    d--;
                }
                if (j == n)
                break;
                j++;
                if ((j == n && s) || (d == 0 && s))
                {
                    bool c = false;
                    while (x <= n)
                    {
                        if (!t[x].z && t[x].qochdi == 0)
                        {
                            t[x].qochdi = 1;
                            ayir = t[x].yuguribbaqiradi;
                            for (int i = x+1 ; i <= n ; i++)
                            {
                                t[i].bardoshi -= ayir;
                                if (t[i].bardoshi < 0)
                                {
                                    c = true;
                                    t[i].z = false;
                                }
                            }
                        }
                        x++;
                    }
                    s = false;
                }
            }
        }
    }
    int c = 0;
    for (int i = 1 ; i <= n ; i++)
    {
        if (t[i].z)
        {
            c++;
            b[c] = i;
        }
    }
    cout << c << endl;
    for (int i = 1 ; i <= c ; i++)
    {
        cout << b[i] <<" ";
    }
}


#include <iostream>

using namespace std;
struct bola
{
	int xonadabaqiradi, koridordabaqiradi, bardoshi;
};
int main()
{
	bola t[100001];
	int n, g = 0, b[4001], c = 0, d;
	cin >> n;
	for (int i = 1 ; i <= n ; i++)
	{
		cin >> t[i].xonadabaqiradi >> t[i].koridordabaqiradi >> t[i].bardoshi;
	}
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].bardoshi < 0)
		{
			int e = i+1;
			int u = t[i].koridordabaqiradi;
			while (e <= n)
			{
				t[e].bardoshi -= u;
				e++;
			}
		}
		else
		{
			d = t[i].xonadabaqiradi;
			int j = i+1;
			while (d > 0)
			{
				if (t[j].bardoshi >= 0)
				{
					t[j].bardoshi -= d;
					if (j == n)
					break;
					d--;
				}
				j++;
			}
		}
	}
	for (int i = 1 ; i < n ; i++)
	{
		if (t[i].bardoshi >= 0)
		{
			g++;
			b[c++] = i;
		}
	}
	cout << g << endl;
	for (int i = 0 ; i < c ; i++)
	{
		cout << b[i] << " ";
	}
}


#include <iostream>

using namespace std;
struct bola
{
	int xonadabaqiradi, koridordabaqiradi, bardoshi;
};
int main()
{
	bola t[100001];
	int n, g = 0, b[4001], c = 0, d;
	cin >> n;
	for (int i = 1 ; i <= n ; i++)
	{
		cin >> t[i].xonadabaqiradi >> t[i].koridordabaqiradi >> t[i].bardoshi;
	}
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].bardoshi >= 0)
		{
			d = t[i].xonadabaqiradi;
			int j = i+1;
			while (d > 0)
			{
				if (t[j].bardoshi >= 0)
				{
					t[j].bardoshi -= d;
					if (t[j].bardoshi < 0)
					{
						int e = j+1;
						int u = t[j].koridordabaqiradi;
						while (e <= n)
						{
							t[e].bardoshi -= u;
							e++;
						}
					}
					if (j > n)
					break;
					d--;
				}
				j++;
			}
		}
	}
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].bardoshi > -1)
		{
			g++;
			b[c++] = i;
		}
	}
	cout << g << endl;
	for (int i = 0 ; i < c ; i++)
	{
		cout << b[i] << " ";
	}
}


#include <iostream>

using namespace std;
struct bola
{
	int xonadabaqiradi, koridordabaqiradi, bardoshi;
};
int main()
{
	bola t[100001];
	int n, g = 0, b[4001], c = 0, d;
	cin >> n;
	for (int i = 1 ; i <= n ; i++)
	{
		cin >> t[i].xonadabaqiradi >> t[i].koridordabaqiradi >> t[i].bardoshi;
	}
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].bardoshi < 0)
		{
			int e = i+1;
			int u = t[i].koridordabaqiradi;
			while (e <= n)
			{
				t[e].bardoshi -= u;
				e++;
			}
		}
		else
		{
			d = t[i].xonadabaqiradi;
			int j = i+1;
			while (d > 0)
			{
				if (t[j].bardoshi >= 0)
				{
					t[j].bardoshi -= d;
					if (j == n)
					break;
					d--;
				}
				j++;
			}
		}
	}
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].bardoshi >= 0)
		{
			g++;
			b[c++] = i;
		}
	}
	cout << g << endl;
	for (int i = 0 ; i < c ; i++)
	{
		cout << b[i] << " ";
	}
}


#include <iostream>
#include <vector>

using namespace std;
struct bola
{
	int xonadabaqiradi, yuguribbaqiradi, bardoshi, qochdi = 0;
	bool z = true;
} t[1000001];
int n, b[4001], x, ayir;
int main()
{
	bool s = false;
	cin >> n;
	for (int i = 1 ; i <= n ; i++)
	{
		cin >> t[i].xonadabaqiradi >> t[i].yuguribbaqiradi >> t[i].bardoshi;
	}
	int i = 0;
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].qochdi == 0)
		{
			int d = t[i].xonadabaqiradi;
			int j = 0; j = i + 1;
			x = i+1;
			while (d > 0)
			{
				if (t[j].z && t[i].qochdi == 0)
				{
					t[j].bardoshi -= d;
					if (t[j].bardoshi < 0)
					{
						t[j].z = false;
						s = true;
					}
					d--;
				}
				if (j == n)
				break;
				j++;
				if (j == n && s)
				{
					bool c = false;
					while (x <= n)
					{
						if (!t[x].z && t[x].qochdi == 0)
						{
							t[x].qochdi = 1;
							ayir = t[x].yuguribbaqiradi;
							for (int i = x+1 ; i <= n ; i++)
							{
								t[i].bardoshi -= ayir;
								if (t[i].bardoshi < 0)
								{
									c = true;
									t[i].z = false;
								}
							}
						}
						x++;
					}
					s = false;
				}
			}
		}
	}
	int c = 0;
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].z)
		{
			c++;
			b[c] = i;
		}
	}
	cout << c << endl;
	for (int i = 1 ; i <= c ; i++)
	{
		cout << b[i] <<" ";
	}
}


#include <bits/stdc++.h>

using namespace std;
struct bola
{
    int xonadabaqiradi, yuguribbaqiradi, bardoshi, qochdi = 0;
    bool z = true;
} t[1000001];
int n, b[400001], x, ayir, c = 0;
int main()
{
    bool s = false;
    cin >> n;
    for (int i = 1 ; i <= n ; i++)
    {
        cin >> t[i].xonadabaqiradi >> t[i].yuguribbaqiradi >> t[i].bardoshi;
    }
    for (int i = 1 ; i <= n ; i++)
    {
        if (t[i].qochdi == 0)
        {   b[c++] = i;
            int d = t[i].xonadabaqiradi;
            int j = 0; j = i + 1;
            x = i+1;
            while (d > 0)
            {
                if (t[j].z && t[i].qochdi == 0)
                {
                    t[j].bardoshi -= d;
                    if (t[j].bardoshi < 0)
                    {
                        t[j].z = false;
                        s = true;
                    }
                    d--;
                }
                if (j == n)
                break;
                j++;
                if ((j == n && s) || (d == 0 && s))
                {
                    bool c = false;
                    while (x <= n)
                    {
                        if (!t[x].z && t[x].qochdi == 0)
                        {
                            t[x].qochdi = 1;
                            ayir = t[x].yuguribbaqiradi;
                            for (int i = x+1 ; i <= n ; i++)
                            {
                                t[i].bardoshi -= ayir;
                                if (t[i].bardoshi < 0)
                                {
                                    c = true;
                                    t[i].z = false;
                                }
                            }
                        }
                        x++;
                    }
                    s = false;
                }
            }
        }
    }
    cout << c << endl;
    for (int i = 1 ; i < c ; i++)
    {
        cout << b[i] <<" ";
    }
    return 0;
}


#include <iostream>

using namespace std;
struct bola
{
	int xonadabaqiradi, koridordabaqiradi, bardoshi;
};
int main()
{
	bola t[100001];
	int n, g = 0, b[4001], c = 0, d;
	cin >> n;
	for (int i = 1 ; i <= n ; i++)
	{
		cin >> t[i].xonadabaqiradi >> t[i].koridordabaqiradi >> t[i].bardoshi;
	}
	for (int i = 2 ; i <= n ; i++)
	{
		if (t[i].bardoshi >= 0)
		{
			if (t[i-1].bardoshi > -1)
			{
				d = t[i-1].xonadabaqiradi;
				int j = i;
				while (d > 0)
				{
					if (t[j].bardoshi > -1)
					{
						t[j].bardoshi -= d;
					}
					if (j == n)
					break;
					d--;
					j++;
				}
			}
			else
			{
				i++;
				d = t[i-1].xonadabaqiradi;
				int j = i;
				while (d > 0)
				{
					if (t[j].bardoshi > -1)
					{
						t[j].bardoshi -= d;
					}
					if (j == n)
					break;
					d--;
					j++;
				}
			}
		}
		if (t[i].bardoshi < 0)
		{
			int e = i+1;
			while ( e <= n )
			{
				t[e].bardoshi -= t[i].koridordabaqiradi;
				e++;
			}
		}
	}
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].bardoshi > -1)
		{
			g++;
			b[c++] = i;
		}
	}
	cout << g << endl;
	for (int i = 0 ; i < c ; i++)
	{
		cout << b[i] << " ";
	}
}


#include <iostream>

using namespace std;
struct bola
{
	int xonadabaqiradi, koridordabaqiradi, bardoshi;
};
int main()
{
	bola t[100001];
	int n, g = 0, b[4001], c = 0, d;
	cin >> n;
	for (int i = 1 ; i <= n ; i++)
	{
		cin >> t[i].xonadabaqiradi >> t[i].koridordabaqiradi >> t[i].bardoshi;
	}
	for (int i = 2 ; i <= n ; i++)
	{
		if (t[i].bardoshi >= 0)
		{
			if (t[i-1].bardoshi > -1)
			{
				d = t[i-1].xonadabaqiradi;
				int j = i;
				while (d > 0)
				{
					if (t[j].bardoshi > -1)
					{
						t[j].bardoshi -= d;
					}
					d--;
					j++;
				}
				if (t[i].bardoshi < 0)
				{
					int e = i+1;
					while ( e <= n )
					{
						t[e].bardoshi -= t[i].koridordabaqiradi;
						e++;
					}
				}
			}
		}
	}
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].bardoshi > -1)
		{
			g++;
			b[c++] = i;
		}
	}
	cout << g << endl;
	for (int i = 0 ; i < c ; i++)
	{
		cout << b[i] << " ";
	}
}


#include <iostream>
#include <vector>

using namespace std;
void minused(int ayir, int index);
struct bola
{
	int xonadabaqiradi, yuguribbaqiradi, bardoshi;
	bool z = true;
} t[1000001];
int n, b[4001];
int main()
{
	cin >> n;
	for (int i = 1 ; i <= n ; i++)
	{
		cin >> t[i].xonadabaqiradi >> t[i].yuguribbaqiradi >> t[i].bardoshi;
	}
	int i = 0;
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].bardoshi >= 0 && t[i].z == true)
		{
			int d = t[i].xonadabaqiradi;
			int j = 0; j = i + 1;
			while (d > 0)
			{
				if (t[j].z)
				{
					t[j].bardoshi -= d;
					if (t[j].bardoshi < 0)
					{
						t[j].z = false;
					}
					else
						t[j].z = true;

					if (!t[j].z)
					{
						int f = t[j].yuguribbaqiradi;
						int it = j+1;
						minused(f, it);
					}
				d--;
				}
				if (j == n)  break;
				j++;
			}
		}
	}
	int c = 0;
	for (int i = 1 ; i <= n ; i++)
	{
		if (t[i].z)
		{
			c++;
			b[c] = i;
		}
	}
	cout << c << endl;
	for (int i = 1 ; i <= c ; i++)
	{
		cout << b[i] <<" ";
	}
}
void minused(int ayir, int index)
{
	int q = index;
	t[index-1].yuguribbaqiradi = 0;
	while (index <= n)
	{
		t[index].bardoshi -= ayir;
		if (t[index].bardoshi < 0) t[index].z = false;
		if (index == n)
		{
			for (int i = q ; i <= n ; i++)
			{
				if (!t[i].z)
				{
					minused(t[i].yuguribbaqiradi, i+1);
				}
			}
		}
		index++;
	}
}


#include <iostream>
#include <vector>
using namespace std;
int V[4005];
int D[4005];
int P[4005];
vector<int> Ans;
int main()
{
    int n, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> V[i] >> D[i] >> P[i];
    }
    long long ind;
    for (int g = 0; g < n; ++g)
    {
        ind = 0;
        if(P[g] >= 0)
        {
            k = g + 1;
            Ans.push_back(k);
            for (int t = g + 1; t < n; ++t )
            {
                //cout << "t = " << t << endl;
                if (P[t] >= 0)
                {
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    P[t] = P[t] - (V[g] - (t - g - 1)) - ind;
                    if (P[t] < 0)
                    {
                        ind = ind + D[t];
                    }
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    //cout << "ind = " << ind << endl;
                }
            }
        }
    }
    cout << Ans.size() << endl;
    for (int y = 0; y < Ans.size(); ++y)
    {
        cout << Ans[y] << " ";
    }
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
int V[4005];
int D[4005];
int P[4005];
vector<int> Ans;
int main()
{
    int n, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> V[i] >> D[i] >> P[i];
    }
    long long ind;
    for (int g = 0; g < n; ++g)
    {
        cout << "g = " << g << endl;
        ind = 0;
        if(P[g] >= 0)
        {
            k = g + 1;
            Ans.push_back(k);
            for (int t = g + 1; t < n; ++t )
            {
                //cout << "t = " << t << endl;
                if (P[t] >= 0)
                {
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    P[t] = (P[t] - (V[g] - (t - g - 1)) - ind);
                    if (P[t] < 0)
                    {
                        ind = ind + D[t];
                    }
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    //cout << "ind = " << ind << endl;
                }
            }
        }
    }
    cout << Ans.size() << endl;
    for (int y = 0; y < Ans.size(); ++y)
    {
        cout << Ans[y] << " ";
    }
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
int V[4005];
int D[4005];
int P[4005];
vector<int> Ans;
int main()
{
    int n, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> V[i] >> D[i] >> P[i];
    }
    long long ind = 0;
    for (int g = 0; g < n; ++g)
    {
        if(P[g] >= 0)
        {
            k = g + 1;
            //cout << "k = " << k << endl;
            Ans.push_back(k);
            //cout << "g = " << g << endl;
            for (int t = g + 1; t < n; ++t )
            {
                //cout << "I am here" << endl;
                //cout << "t = " << t << endl;
                if (P[t] >= 0)
                {
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    P[t] = P[t] - (V[g] - (t - g - 1)) - ind;
                    if (P[t] < 0)
                    {
                        ind = ind + D[t];
                    }
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    //cout << "ind = " << ind << endl;
                }
            }
        }
    }
    cout << Ans.size() << endl;
    for (int y = 0; y < (Ans.size() - 1); ++y)
    {
        cout << Ans[y] << " ";
    }
    cout << Ans[Ans.size() - 1];
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
int V[4005];
int D[4005];
int P[4005];
vector<int> Ans;
int main()
{
    int n, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> V[i] >> D[i] >> P[i];
    }
    long long ind;
    for (int g = 0; g < n; ++g)
    {
        //cout << "g = " << g << endl;
        ind = 0;
        if(P[g] >= 0)
        {
            k = g + 1;
            Ans.push_back(k);
            for (int t = g + 1; t < n; ++t )
            {
                //cout << "t = " << t << endl;
                if (P[t] >= 0)
                {
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    P[t] = (P[t] - (V[g] - (t - g - 1)) - ind);
                    if (P[t] < 0)
                    {
                        ind = ind + D[t];
                    }
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    //cout << "ind = " << ind << endl;
                }
            }
        }
    }
    cout << Ans.size() << endl;
    for (int y = 0; y < Ans.size(); ++y)
    {
        cout << Ans[y] << " ";
    }
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
int V[4005];
int D[4005];
int P[4005];
vector<int> Ans;
int main()
{
    int n, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> V[i] >> D[i] >> P[i];
    }
    long long ind = 0;
    for (int g = 0; g < n; ++g)
    {
        if(P[g] >= 0)
        {
            k = g + 1;
            //cout << "k = " << k << endl;
            Ans.push_back(k);
            //cout << "g = " << g << endl;
            for (int t = g + 1; t < n; ++t )
            {
                //cout << "I am here" << endl;
                //cout << "t = " << t << endl;
                if (P[t] >= 0)
                {
                    ind = 0;
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    P[t] = P[t] - (V[g] - (t - g - 1)) - ind;
                    if (P[t] < 0)
                    {
                        ind = ind + D[t];
                    }
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    //cout << "ind = " << ind << endl;
                }
            }
        }
    }
    cout << Ans.size() << endl;
    for (int y = 0; y < (Ans.size() - 1); ++y)
    {
        cout << Ans[y] << " ";
    }
    cout << Ans[Ans.size() - 1];
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
long long V[4005];
long long D[4005];
long long P[4005];
vector<int> Ans;
int main()
{
    long long n, k;
    cin >> n;
    for (long long i = 0; i < n; ++i)
    {
        cin >> V[i] >> D[i] >> P[i];
    }
    long long ind;
    long long cry;
    for (long long g = 0; g < n; ++g)
    {
        //cout << "g = " << g << endl;
        ind = 0;
        if(P[g] >= 0)
        {
            k = g + 1;
            Ans.push_back(k);
            cry = V[g] + 1;
            for (long long t = g + 1; t < n; ++t )
            {
                //cout << "t = " << t << endl;
                if (P[t] >= 0)
                {
                    if (cry > 0)
                    {
                        cry--;
                    }
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    P[t] = (P[t] - cry - ind);
                    if (P[t] < 0)
                    {
                        ind = ind + D[t];
                    }
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    //cout << "ind = " << ind << endl;
                }
            }
        }
    }
    cout << Ans.size() << endl;
    for (long long y = 0; y < Ans.size(); ++y)
    {
        cout << Ans[y] << " ";
    }
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
int V[4005];
int D[4005];
int P[4005];
vector<int> Ans;
int main()
{
    int n, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> V[i] >> D[i] >> P[i];
    }
    long long ind;
    for (int g = 0; g < n; ++g)
    {
        ind = 0;
        if(P[g] >= 0)
        {
            k = g + 1;
            //cout << "k = " << k << endl;
            Ans.push_back(k);
            //cout << "g = " << g << endl;
            for (int t = g + 1; t < n; ++t )
            {
                //cout << "I am here" << endl;
                //cout << "t = " << t << endl;
                if (P[t] >= 0)
                {
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    P[t] = P[t] - (V[g] - (t - g - 1)) - ind;
                    if (P[t] < 0)
                    {
                        ind = ind + D[t];
                    }
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    //cout << "ind = " << ind << endl;
                }
            }
        }
    }
    cout << Ans.size() << endl;
    for (int y = 0; y < (Ans.size() - 1); ++y)
    {
        cout << Ans[y] << " ";
    }
    cout << Ans[Ans.size() - 1];
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
int V[4005];
int D[4005];
int P[4005];
vector<int> Ans;
int main()
{
    int n, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> V[i] >> D[i] >> P[i];
    }
    long long ind = 0;
    for (int g = 0; g < n; ++g)
    {
        if(P[g] >= 0)
        {
            k = g + 1;
            //cout << "k = " << k << endl;
            Ans.push_back(k);
            //cout << "g = " << g << endl;
            ind = 0;
            for (int t = g + 1; t < n; ++t )
            {
                //cout << "I am here" << endl;
                //cout << "t = " << t << endl;
                if (P[t] >= 0)
                {
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    P[t] = P[t] - (V[g] - (t - g - 1)) - ind;
                    if (P[t] < 0)
                    {
                        ind = ind + D[t];
                    }
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    //cout << "ind = " << ind << endl;
                }
            }
        }
    }
    cout << Ans.size() << endl;
    for (int y = 0; y < (Ans.size() - 1); ++y)
    {
        cout << Ans[y] << " ";
    }
    cout << Ans[Ans.size() - 1];
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
int V[4005];
int D[4005];
int P[4005];
vector<int> Ans;
int main()
{
    int n, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> V[i] >> D[i] >> P[i];
    }
    long long ind;
    int cry;
    for (int g = 0; g < n; ++g)
    {
        //cout << "g = " << g << endl;
        ind = 0;
        if(P[g] >= 0)
        {
            k = g + 1;
            Ans.push_back(k);
            cry = V[g] + 1;
            for (int t = g + 1; t < n; ++t )
            {
                //cout << "t = " << t << endl;
                if (P[t] >= 0)
                {
                    if (cry > 0)
                    {
                        cry--;
                    }
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    P[t] = (P[t] - cry - ind);
                    if (P[t] < 0)
                    {
                        ind = ind + D[t];
                    }
                    //cout << "P[" << t << "]=" << P[t] << endl;
                    //cout << "ind = " << ind << endl;
                }
            }
        }
    }
    cout << Ans.size() << endl;
    for (int y = 0; y < Ans.size(); ++y)
    {
        cout << Ans[y] << " ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ot(x) cout<<x<<endl
#define cen cout<<endl
#define EPS 1e-10
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define DFS_GRAY 2
#define DFS_WHITE -1
#define DFS_BLACK 1
#define INF 1000000000
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<double,double> pdd;

ll n,m,i,t,j,k,l;
ll a[10010],b[10010],c[5010];
bool f[10010];
ll cr,br;
vi ans;

int main(){
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(i=0;i<n;i++){
        if(i==0){
            cr=a[i];
            f[min(i+a[i],(ll)5000)]=1;
            t++;
            l=1;
            ans.push_back(i+1);
        }else{
            c[i]-=cr;
            c[i]-=br;
            cr=max(cr-l,(ll)0);
            if(c[i]<0)br+=b[i];
            else {
                cr+=a[i];
                f[min(i+a[i],(ll)5000)]=1;
                l++;
                t++;
                ans.push_back(i+1);
            }
            if(f[i])l--;
        }
    }
    ot(t);
    for(i=0;i<ans.size();i++){
        cout<<ans[i];
        if(i!=ans.size()-1)cout<<" ";
    }cen;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ot(x) cout<<x<<endl
#define cen cout<<endl
#define EPS 1e-10
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define DFS_GRAY 2
#define DFS_WHITE -1
#define DFS_BLACK 1
#define INF 1000000000
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<double,double> pdd;

ll n,m,i,t,j,k,l;
ll a[10010],b[10010],c[5010];
bool f[10010];
ll cr,br;
vi ans;
vi ra;

int main(){
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(i=0;i<n;i++){
        if(c[i]>=0){
            t++;
            ans.pb(i+1);
            j=i+1;
            k=a[i];
            while(k && j<n){
                if(c[j]>=0){
                    c[j]-=k;
                    k--;
                }
                j++;
            }
        }else{
            for(j=i+1;j<n;j++){
                c[j]-=b[i];
            }
        }
    }
    ot(t);
    for(i=0;i<ans.size();i++){
        cout<<ans[i];
        if(i!=ans.size()-1)cout<<" ";
    }cen;
    return 0;
}
/*
4
3 2 1
2 1 3
2 1 1
2 1 3
*/


#include<bits/stdc++.h>
using namespace std;
#define ot(x) cout<<x<<endl
#define cen cout<<endl
#define EPS 1e-10
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define DFS_GRAY 2
#define DFS_WHITE -1
#define DFS_BLACK 1
#define INF 1000000000
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<double,double> pdd;

ll n,m,i,t,j,k,l;
ll a[10010],b[10010],c[5010];
bool f[10010];
ll cr,br;
vi ans;

int main(){
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(i=0;i<n;i++){
        if(i==0){
            cr=a[i];
            f[min(i+a[i],(ll)5000)]=1;
            t++;
            l=1;
            ans.push_back(i+1);
        }else{
            c[i]-=cr;
            c[i]-=br;
            if(c[i]<0)br+=b[i];
            else {

                cr=max(cr-l,(ll)0);
                cr+=a[i];
                f[min(i+a[i],(ll)5000)]=1;
                l++;
                t++;
                ans.push_back(i+1);
            }
            if(f[i])l--;
        }
    }
    ot(t);
    for(i=0;i<ans.size();i++){
        cout<<ans[i];
        if(i!=ans.size()-1)cout<<" ";
    }cen;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ot(x) cout<<x<<endl
#define cen cout<<endl
#define EPS 1e-10
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define DFS_GRAY 2
#define DFS_WHITE -1
#define DFS_BLACK 1
#define INF 1000000000
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<double,double> pdd;

ll n,m,i,t,j,k,l;
ll a[10010],b[10010],c[5010];
bool f[10010];
ll cr,br;
vi ans;

int main(){
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(i=0;i<n;i++){
        if(i==0){
            cr=a[i];
            f[i+a[i]]=1;
            t++;
            l=1;
            ans.push_back(i+1);
        }else{
            c[i]-=cr;
            c[i]-=br;
            cr=max(cr-l,(ll)0);
            if(c[i]<0)br+=b[i];
            else {
                cr+=a[i];
                f[min(i+a[i],(ll)5000)]=1;
                l++;
                t++;
                ans.push_back(i+1);
            }
            if(f[i])l--;
        }
    }
    ot(t);
    for(i=0;i<ans.size();i++){
        cout<<ans[i];
        if(i!=ans.size()-1)cout<<" ";
    }cen;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ot(x) cout<<x<<endl
#define cen cout<<endl
#define EPS 1e-10
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define DFS_GRAY 2
#define DFS_WHITE -1
#define DFS_BLACK 1
#define INF 1000000000
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<double,double> pdd;

ll n,m,i,t,j,k,l;
ll a[4010],b[4010],c[4010];
bool f[4010];
ll cr,br;
vi ans;

int main(){
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(i=0;i<n;i++){
        if(i==0){
            cr=a[i];
            f[i+a[i]]=1;
            t++;
            l=1;
            ans.push_back(i+1);
        }else{
            c[i]-=cr;
            c[i]-=br;
            cr=max(cr-l,(ll)0);
            if(c[i]<0)br+=b[i];
            else {
                cr+=a[i];
                f[i+a[i]]=1;
                l++;
                t++;
                ans.push_back(i+1);
            }
            if(f[i])l--;
        }
    }
    ot(t);
    for(i=0;i<ans.size();i++){
        cout<<ans[i];
        if(i!=ans.size()-1)cout<<" ";
    }cen;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ot(x) cout<<x<<endl
#define cen cout<<endl
#define EPS 1e-10
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define DFS_GRAY 2
#define DFS_WHITE -1
#define DFS_BLACK 1
#define INF 1000000000
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<double,double> pdd;

ll n,m,i,t,j,k,l;
ll a[4010],b[4010],c[4010];
ll cr,br;
vi ans;

int main(){
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(i=0;i<n;i++){
        if(i==0){
            cr=a[i];
            t++;
            ans.push_back(i+1);
        }else{
            c[i]-=cr;
            c[i]-=br;
            cr=max(cr-1,(ll)0);
            if(c[i]<0)br+=b[i];
            else {
                cr+=a[i];
                t++;
                ans.push_back(i+1);
            }
        }
    }
    ot(t);
    for(i=0;i<ans.size();i++){
        cout<<ans[i];
        if(i!=ans.size()-1)cout<<" ";
    }cen;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ot(x) cout<<x<<endl
#define cen cout<<endl
#define EPS 1e-10
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define DFS_GRAY 2
#define DFS_WHITE -1
#define DFS_BLACK 1
#define INF 1000000000
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<double,double> pdd;

ll n,m,i,t,j,k,l;
ll a[4010],b[4010],c[4010];
ll cr,br;
vi ans;

int main(){
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(i=0;i<n;i++){
        if(i==0){
            cr=a[i];
            t++;
            ans.push_back(i+1);
        }else{
            c[i]-=cr;
            c[i]-=br;
            cr=max(cr-1,0);
            if(c[i]<0)br+=b[i];
            else {
                cr+=a[i];
                t++;
                ans.push_back(i+1);
            }
        }
    }
    ot(t);
    for(i=0;i<ans.size();i++){
        cout<<ans[i];
        if(i!=ans.size()-1)cout<<" ";
    }cen;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ot(x) cout<<x<<endl
#define cen cout<<endl
#define EPS 1e-10
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define DFS_GRAY 2
#define DFS_WHITE -1
#define DFS_BLACK 1
#define INF 1000000000
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<double,double> pdd;

ll n,m,i,t,j,k,l;
ll a[10010],b[10010],c[5010];
bool f[10010];
ll cr,br;
vi ans;

int main(){
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(i=0;i<n;i++){
        if(i==0){
            cr=a[i];
            f[min(i+a[i],(ll)5000)]=1;
            t++;
            l=1;
            ans.push_back(i+1);
        }else{
            if(c[i]<0)br+=b[i];
            else {
                c[i]-=cr;
                c[i]-=br;
                cr=max(cr-l,(ll)0);
                if(c[i]<0)
                    br+=b[i];
                else{
                    cr+=a[i];
                    f[min(i+a[i],(ll)5000)]=1;
                    l++;
                    t++;
                    ans.push_back(i+1);
                }
            }
            if(f[i])l--;
        }
    }
    ot(t);
    for(i=0;i<ans.size();i++){
        cout<<ans[i];
        if(i!=ans.size()-1)cout<<" ";
    }cen;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ot(x) cout<<x<<endl
#define cen cout<<endl
#define EPS 1e-10
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define DFS_GRAY 2
#define DFS_WHITE -1
#define DFS_BLACK 1
#define INF 1000000000
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<double,double> pdd;

ll n,m,i,t,j,k,l;
ll a[10010],b[10010],c[5010];
bool f[10010];
ll cr,br;
vi ans;
vi ra;

int main(){
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(i=0;i<n;i++){
        if(c[i]>=0){
            t++;
            ans.pb(i+1);
            j=i+1;
            k=a[i];
            while(k>=1 && j<n){
                if(c[j]>=0){
                    c[j]-=k;
                    k--;
                }
                j++;
            }
            br=0;
            for(j=i+1;j<n;j++){
                if(c[j]<0 && !f[j]){
                    br+=b[j];
                    f[j]=1;
                }else{
                    c[j]-=br;
                    if(c[j]<0 && !f[j]){
                        br+=b[j];
                        f[j]=1;
                    }
                }
            }
        }
    }
    ot(t);
    for(i=0;i<ans.size();i++){
        cout<<ans[i];
        if(i!=ans.size()-1)cout<<" ";
    }cen;
    return 0;
}
/*
4
3 2 1
2 1 3
2 1 1
2 1 3
*/


#include<bitset>
#include<map>
#include<vector>
#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
#include<stack>
#include<queue>
#include<set>
#define inf 0x3f3f3f3f
#define mem(a,x) memset(a,x,sizeof(a))

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

inline int in()
{
    int res=0;char c;
    while((c=getchar())<'0' || c>'9');
    while(c>='0' && c<='9')res=res*10+c-'0',c=getchar();
    return res;
}
const int N=4010;

struct st
{
    int v,d,p;
} a[N];

int ans[N];
bool out[N];
queue<int> q;

void fun(int x,int y,int n)
{
    q.push(x);
    out[x]=1;
    while(!q.empty())
    {
        int now = q.front();
        q.pop();

        out[now]=1;
        int lound=a[now].d;
        for(int i=now+1;i<=n;i++)
        {
            if(!out[i])
            {
                a[i].p -= lound;
                if(a[i].p < 0)
                {
                    out[i]=1;
                    q.push(i);
                    //lound += a[i].d;
                }

            }

        }
    }
}
int main()
{
    int n=in();
    for(int i=1;i<=n;i++)
    {
        a[i].v=in(),a[i].d=in(),a[i].p=in();

    }
    int cnt=0;
    for(int i=1;i<=n;i++)
    {
        if(!out[i])
        {
            ans[cnt++]=i;
            a[i].v--;
            for(int j=i+1;j<=n && a[i].v;j++)
            {
                if(!out[j])
                {
                    a[j].p -= max(0,a[i].v);
                    if(a[j].p <= 0)
                    {
                        //fun(j,a[i].v,n);
                        out[j]=1;
                        for(int k=j+1;k<=n;k++)
                        {
                            if(out[k])continue;
                            a[k].p -= a[j].d;
                            if(a[k].p <= 0)
                            {
                                out[k]=1;
                                a[j].d += a[k].d;
                            }
                        }
                    }
                    a[i].v--;
                }

            }
        }
    }
    printf("%d\n",cnt);
    for(int i=0;i<cnt;i++)
    {
        printf("%d ",ans[i]);
    }
    return 0;
}


#include<bitset>
#include<map>
#include<vector>
#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
#include<stack>
#include<queue>
#include<set>
#define inf 0x3f3f3f3f
#define mem(a,x) memset(a,x,sizeof(a))

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

inline int in()
{
    int res=0;char c;
    while((c=getchar())<'0' || c>'9');
    while(c>='0' && c<='9')res=res*10+c-'0',c=getchar();
    return res;
}
const int N=4010;

struct st
{
    int v,d,p;
} a[N];

int ans[N];
bool out[N];
queue<int> q;

void fun(int x,int y,int n)
{
    q.push(x);
    out[x]=1;
    while(!q.empty())
    {
        int now = q.front();
        q.pop();

        out[now]=1;
        int lound=a[now].d;
        for(int i=now+1;i<=n;i++)
        {
            if(!out[i])
            {
                a[i].p -= lound;
                if(a[i].p < 0)
                {
                    out[i]=1;
                    q.push(i);
                    lound += a[i].d;
                }

            }

        }
    }
}
int main()
{
    int n=in();
    for(int i=1;i<=n;i++)
    {
        a[i].v=in(),a[i].d=in(),a[i].p=in();

    }
    int cnt=0;
    for(int i=1;i<=n;i++)
    {
        if(!out[i])
        {
            ans[cnt++]=i;
            a[i].v--;
            for(int j=i+1;j<=n && a[i].v;j++)
            {
                if(!out[j])
                {
                    a[j].p -= max(0,a[i].v);
                    if(a[j].p < 0)
                    {
                        fun(j,a[i].v,n);
                    }

                }
                a[i].v--;
            }
        }
    }
    printf("%d\n",cnt);
    for(int i=0;i<cnt;i++)
    {
        printf("%d ",ans[i]);
    }
    return 0;
}