#include <bits/stdc++.h>
#define fastio std::ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pii;
typedef complex<double> inum;
const double PI = acos(-1);
const int INF = INT_MAX;
const ll LLINF = LLONG_MAX >> 4;
const ll MAX = 100001; // depending on the problem
const ll MOD = 998244353; // depending on the problem


ll N, M;
ll D[MAX];
vector<ll> visited;
vector<ll> temp;

void solve() {
    cin >> N >> M;
    D[0] = 0; visited.push_back(0);

    for (int t = 1; t <= N; t++) {
        ll type, x, y; cin >> type >> x >> y;

        // 더하기
        if (type == 1) {
            x += 99999;
            ll d = x / 100000;
            for (auto it : visited) {
                for (int i = 1; i <= y && it + i * d <= M; i++) {
                    if (D[it + i * d] != -1 && D[it + i * d] <= t) { break; }

                    if (D[it + i * d] == -1) { temp.push_back(it + i * d); }
                    D[it + i * d] = t;
                }
            }
            for (int i = 0; i < temp.size(); i++) { visited.push_back(temp[i]); }
            temp.clear();
        }

        // 곱하기
        else {
            for (auto it : visited) {
                ll cur, times;
                cur = it; times = y;

                while (times--) {
                    ll now = (cur * x + 99999) / 100000;

                    if (now > M || D[now] != -1 && D[now] <= t) { break; }
                    if (D[now] == -1) { temp.push_back(now); }
                    D[now] = t;
                    cur = now;
                }
            }
            for (int i = 0; i < temp.size(); i++) { visited.push_back(temp[i]); }
            temp.clear();

        }
    }

    for (int i = 1; i <= M; i++) { cout << D[i] << " "; }
}

int main() {
    fastio;

    memset(D, -1, sizeof(D));
    solve();
    
    

    return 0;
}