#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair <ll, ll> pii;
const ll maxn = 1e5 + 10;
const ll d = 1e5;
ll n, m;
bool vis[maxn];
ll ans[maxn];
void init() {
    memset(ans, -1, sizeof(ans));
    vis[0] = true;
}
queue <pii> que;
void bfs1(ll x, ll y, ll id) {
    for (ll i = 0; i <= m; i++)
        if (vis[i])
            que.push({i, 0});
    pii np, tmp;
    ll res;
    if (x % d) res = x / d + 1;
    else res = x / d;
    while (!que.empty()) {
        np = que.front(), que.pop();
        tmp = {np.first + res, np.second + 1};
        if (tmp.first > m || vis[tmp.first] || tmp.second > y) continue;
        else vis[tmp.first] = true, ans[tmp.first] = id, que.push(tmp);
    }
}
void bfs2(ll x, ll y, ll id) {
    for (ll i = 0; i <= m; i++)
        if (vis[i])
            que.push({i, 0});
    pii np, tmp;
    while (!que.empty()) {
        np = que.front(), que.pop();
        ll res = np.first * x;
        if (res % d) res = res / d + 1;
        else res =  res / d;
        tmp = {res, np.second + 1};
        if (tmp.first > m || vis[tmp.first] || tmp.second > y) continue;
        else vis[tmp.first] = true, ans[tmp.first] = id, que.push(tmp);
    }
}
int main() {
    init();
    cin >> n >> m;
    ll op, x, y;
    for (ll i = 1; i <= n; i++) {
        cin >> op >> x >> y;
        if (op == 1) bfs1(x, y, i);
        else bfs2(x, y, i);
    }
    for (ll i = 1; i <= m; i++)
        cout << ans[i] << " \n"[i == m];
}