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

//#pragma GCC optimize("O3")
 
#define DIM 200009
#define INF ((long long)1e18+9ll)
#define pairll pair<long long,long long>
#define fi first
#define se second
#define ld long double
#define amen exit(0)
#define endl '\n'
#define MODULO 1000000007
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define y1 trymax_lox
#define y2 difjkdsdkf
 
long long i,j,k,l,n,m,res;

vector<pair<long long,pairll> >a;

long long ans[DIM];

set<long long>st1,st2;

int main()
{
    fast;

    cin>>n>>m;
    for(i=1;i<=n;i++){
        cin>>k>>l>>j;
        a.push_back({k,{l,j}});
    }

    st1.insert(0);

    for(i=1;i<=m;i++)ans[i]=INF;

    for(int i=0;i<n;i++){
        vector<long long>nums;
        for(auto to:st1)nums.push_back(to);
        reverse(nums.begin(),nums.end());

        for(auto to:nums){
            long long x=to;
            for(j=1;j<=a[i].se.se;j++){
                if(a[i].fi==1)x=(x*100000+a[i].se.fi+99999)/100000;
                else x=(x*a[i].se.fi)/100000+((x*a[i].se.fi)%100000!=0);

                if(x>m || st1.count(x))break;
                ans[x]=i+1;
                st1.insert(x);
            }
        }
    }

    for(i=1;i<=m;i++){
        if(st1.count(i))cout<<ans[i]<<' ';
        else cout<<-1<<' ';
    }
    cout<<endl;

    amen;
}

/*
100000 100001
100000
*/
