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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
// #define endl '\n'

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;

const ll mod = 1e9 + 7;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll den = 100000;
ll convert_x(ll n) {
	return (n + den - 1) / den;
}
int main() {
    ios::sync_with_stdio(false); 
    cin.tie(0); 

    const int inf = 1 << 30;
    int n, m; cin >> n >> m;
    vector<int> dp(m + 1, inf);
    dp[0] = 0;
    rep(i,0,n) {
    	ll t, x, y;  cin >> t >> x >> y;
    	vector<bool> done(m + 1);

    	for(ll k = m; k >= 0; k--) {
    		if(dp[k] < inf) {
    			if(t == 1) {
    				ll delta = convert_x(x);
    				for(int j = 0; j <= y; j++) {
    					if(delta * j + k > m) break;
    					ll nxt = delta * j + k;

    					// we will have guaranteed finished a multiple above us
    					if(done[nxt]) break;
    					dp[nxt] = min(dp[nxt], i + 1);
    					done[nxt] = true;
    				}
    			} else {
	    			if(dp[k] < inf) {
	    				ll prev = k;
	    				for(int j = 0; j < y; j++) {
	    					ll nxt = convert_x(prev * x);
	    					if(nxt > m) break;
	    					if(done[nxt]) break;
	    					dp[nxt] = min(dp[nxt], i + 1);
	    					prev = nxt;
							done[nxt] = true;
	    				}
	    			}
    			}
    		}
    	}
    }

    for(int i = 1; i <= m; i++) {
    	cout << (dp[i] == inf ? -1 : dp[i]) << " ";
    }
    cout << endl;
}