#include <cstdio>
#include <iostream>
using namespace std;
const int M = 100005;
const int zxy = 100000;
#define int long long
int read()
{
	int x=0,f=1;char c;
	while((c=getchar())<'0' || c>'9') {if(c=='-') f=-1;}
	while(c>='0' && c<='9') {x=(x<<3)+(x<<1)+(c^48);c=getchar();}
	return x*f;
}
int n,m,a[M],b[M];
signed main()
{
	n=read();m=read();
	for(int i=1;i<=m;i++) a[i]=-1;
	for(int r=1;r<=n;r++)
	{
		int t=read(),x=read(),y=read();
		for(int i=1;i<=m;i++) b[i]=M;
		for(int i=0;i<=m;i++)
		{
			if(a[i]!=-1) b[i]=0;
			if(b[i]<=y && a[i]==-1) a[i]=r;
			int to=0;
			if(t==1) to=(zxy*i+x+zxy-1)/zxy;
			else to=(i*x+zxy-1)/zxy;
			if(to<=m) b[to]=min(b[to],b[i]+1);
		}
	}
	for(int i=1;i<=m;i++)
		printf("%lld ",a[i]);
}