#include <bits/stdc++.h>
using namespace std;
#define ll                       long long int
#define MOD                      1000000007
#define pb                       push_back
#define mp                       make_pair
#define ipair                    pair<ll,ll>
#define all(v)                   v.begin(),v.end()
#define rep(a,b,c)               for(a=(ll)b;a<(ll)c;a++)
#define bac(a,b,c)               for(a=(ll)b;a>=(ll)c;a--)
#define se                       second
#define f                        first
#define ios                      ios::sync_with_stdio(false), cout.tie(0), cin.tie(0);
#define vi                       vector<ll>
const ll N = 100091;
/*Variables Start*/
ll x,y,n,i,z,j,k,w,u,q,m,t,ans;
vector<pair<ll,ipair>> v;
vi dp(N, LLONG_MAX);
/*Variables End*/
void solve() {
	cin >> n >> m;
	rep(i,0,n) {
		cin >> t >> x >> y;
		v.pb({t,{x,y}});
	}
	dp[0] = 0;
	rep(i,0,m) {
		rep(j,dp[i],n) {
			ll a = v[j].se.f;
			if(v[j].f == 1) {
				x = i + (a + 99999) / 100000;
				for(int k = 0; k < v[j].se.se and x <= m and dp[x] >= j + 1; k++, x += (a + 99999) / 100000) {
					dp[x] = j + 1;
				}
			}
			else {
				x = (i * a + 99999) / 100000;
				for(int k = 0; k < v[j].se.se and x <= m and dp[x] >= j + 1; k++, x = (x * a + 99999) / 100000) {
					dp[x] = j + 1;
				}
			}
		}	
	}
	rep(i,1,m + 1) {
		if(dp[i] == LLONG_MAX) 
			cout << "-1 ";
		else 
			cout << dp[i] << " ";
	}
}
int main()
{   
    ios;
    int TESTS=1;
    // cin >> TESTS;
    while(TESTS--) {
    	solve();
    }
}