#include "bits/stdc++.h"
/*
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
//ordered_set p; 
//p.find_by_order(3)
//p.order_of_key(6)
*/
//#include <algorithm>
#define sz(x)             (int)((x).size())
#define int long long
#define ll long long 
#define mod 1000000007
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define umap unordered_map
#define uset unordered_set
#define lb lower_bound
#define ub upper_bound
#define endll "\n";
#define all(x) (x).begin(), (x).end()
#define forr(it,x) for(auto it=x.begin();it!=x.end();it++)
#define for1(i,a,b) for(int i=a;i<b;i++)
#define for2(i,a,b) for(int i=a;i>=b;i--)
#define for3(i,a,b) for(long long int i=a;i<b;i++)
#define for4(i,a,b) for(long long int i=a;i>=b;i--)
#define pp pair<int,int>
#define ld long double
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpp vector<pp>
#define vi vector<int>
#define vpll vector<pll>
#define vld vector<ld>
#define vvld vector<vld>
#define vvi vector<vi>
#define vvll vector<vll>
#define vvpll vector<vpll>
#define vvpp vector<vpp>
#define I insert
#define mem(a,x) memset(a,x,sizeof(a))
#define p_queue(a) priority_queue<a,vector<a>,greater<a>>
using namespace std;
//const int dx[8]={1,0,-1,0,1,1,-1,-1},dy[8]={0,1,0,-1,-1,1,-1,1};
//const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1}; 
const int N=1e5;
const int INF = 1e9+5;
/*vector<bool> p(N+1, true);
void sieve()
{
  p[0] = p[1] = false;
  int i,j;
  for (i = 2; i*i <= N; i++) 
  {
      if (p[i]) 
      {
          for (j = i * i; j <=N; j += i)
            {
        p[j] =false;
        }
      }
  }
}*/
/*ll power(ll a1, ll b1){
    ll res = 1;
    while(b1 > 0){
        if(b1 % 2){
            res = 1LL * res * a1 % mod;
        }
        a1 = 1LL * a1 * a1 % mod;
        b1 /= 2;
    }
    return res;
}
ll invmod(ll a1,ll b1){
  return power(a1,b1-2);
}*/
/*ll ncr(int n1,int c1){
  if(n1<c1)
    return 0;
  if(n1==c1||c1==0)
    return 1;
  ll n=n1,c=c1;
  vll fact(n+1,1);
  for1(i,1,n+1){
    fact[i]=fact[i-1];
    fact[i]*=i;
    fact[i]%=mod;
  }
  ll fact1=fact[n];
  ll fact2=fact[c];
  ll fact3=fact[n-c];
  fact1*=invmod(fact2,mod);fact1%=mod;
  fact1*=invmod(fact3,mod);fact1%=mod;
  return fact1;
}*/
/*int c[N];
void generate(){
  for1(i,1,N) c[i]=i;
  for1(i,2,N){
    if(c[i]==i){
      for(int j=i;j<N;j+=i){
        if(c[j]==j){
          c[j]/=i;
        }
      }
    }
  }
}*/
/*int gcd(int a,int b){
    if(a<b) swap(a,b);
    if(b==0) return a;
    a%=b;
    return gcd(b,a);
}*/
/*int lcm(int a,int b){
   return (a*1LL*b)/gcd(a,b);
}*/
int a[N];
int cnt1(int ind,int x1){
  int x=ind+x1/N;
  if(x1%N){
    x++;
  }
  return x;
}
int cnt2(int ind,int x1){
  int x=ind*x1;
  int ans=x/N;
  if(x%N)
    ans++;
  return ans;
}
int32_t main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    //cout<<cnt1(0,300000)<<endll;
    int n,m;cin>>n>>m;
    vi dp(m+1,-1),temp(m+1,-1);dp[0]=0;temp[0]=0;
    for1(i,1,n+1){
      int tt,x1,y;cin>>tt>>x1>>y;
      for1(j,0,m+1){
        if(dp[j]!=-1){
          int ind=j,cnt=0;
          if(tt==1){
             while(cnt<y&&cnt1(ind,x1)<=m&&temp[cnt1(ind,x1)]==-1){
               ind=cnt1(ind,x1);temp[ind]=i;cnt++;
             }
          }
          else{
             while(cnt<y&&cnt2(ind,x1)<=m&&temp[cnt2(ind,x1)]==-1){
               ind=cnt2(ind,x1);temp[ind]=i;cnt++;
             }
          }
        }
      }
      dp=temp;
    }
    for1(i,1,m+1) cout<<dp[i]<<" ";
    cout<<endll;
    return 0;
}

/*

*/


