#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef pair<int, int> pii;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpii;

#define FOR(i, a, b) for (int i = a; i <= (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b); i >= a; i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto &a : x)

#define sz(x) (int)(x).size()
#define popcnt(x) __builtin_popcount(x)
#define low_bo(a, x) (lower_bound(a.begin(), a.end(), x) - a.begin())
#define up_bo(a, x) (upper_bound(a.begin(), a.end(), x) - a.begin())
#define unique(a) a.resize(unique(a.begin(), a.end()) - a.begin())
#define shuffle(a) shuffle(a.begin(), a.end(), rnd)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert

#define cei(x, y) ((x + y - 1) / y)

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MOD = 1000000007;
const char nl = '\n';
const int MX = 150001; //check the limits, dummy
const ll asdf = 100000;

void solve() {
	int n, m;
	cin >> n >> m;
	int t, y;
	ll x;
	vi ret(m + 1, -1);
	ret[0] = 0;
	vector<bool> seen(m + 1, false);
	seen[0] = true;
	F0R(ct, n) {
		auto ns = seen;
		cin >> t >> x >> y;
		ll xp = cei(x, asdf);
		auto op = [&](ll &curr) {
			if (t - 1)
				return cei(x * curr, asdf);
			else
				return curr + xp;
		};
		for (int k = 0; k <= m; k++) {
			if (seen[k]) {
				ll kp = k;
				kp = op(kp);
				F0R(a, y) {
					if (kp > m || kp < 0) break;
					if (seen[kp]) break;
					ns[kp] = true;
					ret[kp] = ct + 1;
					kp = op(kp);
				}
			}
		}
		seen = ns;
	}
	for (int i = 1; i <= m; i++) {
		cout << ret[i] << " ";
	}
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cout.precision(20);
	cout << fixed;

	int T = 1;
	F0R(i, T) {
		solve();
	}
}

// read the question correctly (ll vs int)
// template by bqi343