#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fast  ios::sync_with_stdio(0);cin.tie(0);
#define eb emplace_back
#define pb push_back
#define f first
#define s second
const int mod=1e9+7;
//v.push_back(make_pair(a,b));  
//max({a,b,c,d})<=side-2 and min({a,b,c,d})>=0
 
/* Use the slash-star style comments or the system won't see your
   identification information */
/*
ID: shihhsi1
TASK: milk2
LANG: C++                 
*/
int fastPower(ll x, int n){ 
    ll result = 1; 
    while (n != 0){
        if ((n & 1) == 1){ 
            result *= x;
            result%=mod; 
        } 
        x *= x; 
        x%=mod;
        n >>= 1; 
        } 
        return result;
    } 
int main() {
    fast;
    //ofstream cout ("milk2.out");
    //ifstream cin ("milk2.in"); 
    int n, m, kk=1e5;
    cin >> n >> m;
    vector<int> v(m+1,-1);
    v[0]=0;
    for(int i=1;i<=n;i++){
        ll a,b,c;cin>>a>>b>>c;
        vector<int> vv(m+1,0);
        if(a==1){
            for(int k=0;k<m;k++){
               if(v[k]!=-1 and vv[k]<c){
                   int cnt=k+(b+kk-1)/kk;
                   if (cnt <= m && v[cnt] == -1) v[cnt] = i, vv[cnt] = vv[k] + 1;
               } 
            }
            
        }
        else{
            for(int k=0;k<m;k++){
               if(v[k]!=-1 and vv[k]<c){
                   ll cnt=(1ll * k * b + kk - 1) / kk;
                   if (cnt <= m && v[cnt] == -1) v[cnt] = i, vv[cnt] = vv[k] + 1;
               } 
            }
                
            }
            
        }
        for(int i=0;i<m;i++){
            if(i==m-1)
            cout<<v[m];
            else
            cout<<v[i+1]<<' ';
        }
}