#include <bits/stdc++.h>
using namespace std;
// KACTL start
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
// KACTL end
template<typename C,typename T=typename enable_if<!is_same<C,string>::value,typename C::value_type>::type>
ostream& operator<<(ostream&os,const C&v){os<<"[";bool f=1;for(const T&x:v){if(!f)os<<", ";os<<x;f=0;}return os<<"]";}
template<typename T1,typename T2>
ostream& operator<<(ostream&os,const pair<T1,T2>&p){return os<<"("<<p.first<<", "<<p.second<<")";}
#define nl "\n"
#ifndef DEBUG_393939
ostream cnull(nullptr);
#define cerr cnull
static const int __39 = [](){ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);return 39;}();
#endif

constexpr int DIV = 1e5;
constexpr int INF = 0x3f3f3f3f;

ll ceil(ll x) {
    ll res = x / DIV;
    if (x % DIV) res++;
    return res;
}

int main() {
    int n, m;
    cin >> n >> m;
    /*
    type 1 ops:
    k += a * ceil(x)

    type 2 ops:
    k goes somewhere...

    */
    vi res(m + 1, -1);
    vector<bool> possible(m + 1, false);
    vi prev_steps(m + 1);
    possible[0] = true;
    rep(i, 0, n) {
        int type, ct;
        ll raw_amt;
        cin >> type >> raw_amt >> ct;
        auto get_range = [&](int j) -> pair<int, int> {
            int l, r;
            if (type == 1) {
                int amt = ceil(raw_amt);
                int old = j - amt;
                l = r = old;
            } else {
                // ceil(old * amt) = j
                // j - 1 < old * amt <= j
                // DIV * (j - 1) < old * raw_amt <= DIV * j
                ll lo = (ll) DIV * (j - 1) + 1;
                ll hi = (ll) DIV * j;
                // lo <= old * raw_amt <= hi
                // lo / raw_amt <= old <= hi / raw_amt
                l = lo / raw_amt;
                if (lo % raw_amt) l++;
                r = hi / raw_amt;
            }
            return make_pair(l, r);
        };
        rep(j, 0, m + 1) {
            if (possible[j]) {
                prev_steps[j] = 0;
            } else {
                prev_steps[j] = INF;
            }
        }
        rep(j, 1, m + 1) {
            if (possible[j] && prev_steps[j] == 0) {
                continue;
            }
            auto [l, r] = get_range(j);
            if (l < 0) l = 0;
            if (r >= j) r = j - 1;
            for (int old = l; old <= r; old++) {
                if (possible[old]) {
                    int new_steps = prev_steps[old] + 1;
                    if (new_steps <= ct) {
                        possible[j] = true;
                        prev_steps[j] = min(prev_steps[j], new_steps);
                    }
                }
            }
        }
        rep(j, 1, m + 1) {
            if (possible[j] && res[j] == -1) {
                res[j] = i + 1;
            }
        }
    }
    rep(j, 1, m + 1) {
        if (j > 1) cout << " ";
        cout << res[j];
    }
    cout << nl;
    return 0;
}
