#include<iostream>
#include<algorithm>
#include<bitset>
#include<cmath>
using namespace std;
typedef long long ll;
const int max_n = 1e5+100;
const int ep = 100000;
const int inf = 1e9+10;
bitset<max_n> B;
int A[210][max_n];
ll po[max_n];
int ans[max_n];
int n,m;
int main()
{
	ios::sync_with_stdio(0);
	cin>>n>>m;
	B[0]=1;
	for (int i=1;i<max_n;++i)po[i]=po[i-1]+ep;
	for (int i=1;i<=m;++i)ans[i]=inf;
	for (int i=1;i<=n;++i)
	{
		ll x,y,t;
		cin>>t>>x>>y;
		if (t==1)
		{
			x = (x+ep-1)/ep;
			for (int j=x;j<=m;++j)
			{
				if (B[j]==1)continue;
				if (B[j-x]==1&&A[i][j-x]<y)
				{
					B[j]=1;
					A[i][j]=A[i][j-x]+1;
					ans[j]=min(ans[j],i);
				}
			}
		}
		else
		{
			ll jj=1;
			for (int j=2;j<=m;++j)
			{
				if (B[j]==1)continue;
				while (jj*x+ep-1<po[j])++jj;
				if (jj*x+ep-1>=po[j+1])continue;
				if (B[jj]==1&&A[i][jj]<y)
				{
					B[j]=1;
					A[i][j]=A[i][jj]+1;
					ans[j]=min(ans[j],i);
				}
			}
		}
	}
	
	for (int i=1;i<=m;++i)
	{
		if (ans[i]==inf)
		{
			cout<<"-1 ";
		}
		else cout<<ans[i]<<" ";
	}
}