#include <bits/stdc++.h>
#define ll long long int
#define fr(i,n) for(i=0;i<n;i++)
#define rng(i,a,b) for(i=a;i<b;i++)
#define T long long int T;cin>>T;while(T--)
#define ain(a,n) for(int zzz=0;zzz<n;zzz++){cin>>a[zzz];}
#define aout(a,n) for(int zzz=0;zzz<n;zzz++){cout<<a[zzz+1]<<' ';}cout<<"\n";
#define All(v) v.begin(),v.end()
#define dbg(v) cerr<<">-- "<<#v<<" = "<<v<<"\n";
#define PB push_back
#define MP make_pair
#define N "\n"
const int inf = (1e9+3);
const int M97 = ((int)1e9+7);
using namespace std;

typedef vector<int> Vi;
typedef pair<int,int> Pii;
typedef pair<int,Pii> Piii;
typedef long double ld;

ll i,j,k;

void solve()
{
	int n,m;
	cin >> n >> m;
	
	Vi a(m+1,-1);
	a[0] = 0;
	set<int> st;
	st.insert(0);
	
	int time = 0;
	fr(i,n)
	{
		++time;
		int t,y;
		ll xdash;
		cin >> t >> xdash >> y;
		
		if(t == 1)
		{
			Vi vec;
			for(ll z: st)
			{
				ll x = (xdash + 99999) / ((ll)1e5);
				fr(j,y)
				{
					z = z+x;
					if(z > m)
						break;
					else if(a[z] != -1)
						break;
					vec.PB(z);
					a[z] = time;
				}
			}
			st.insert(All(vec));
		}
		
		else
		{
			Vi vec;
			for(ll z: st)
			{
				fr(j,y)
				{
					z = (z*xdash+99999) / ((ll)1e5);
					if(z > m)
						break;
					else if(a[z] != -1)
						break;
					vec.PB(z);
					a[z] = time;
				}
			}
			st.insert(All(vec));
		}
	}
	
	aout(a,m)
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
		
	solve();
    
    return 0;
}
