#include <bits/stdc++.h>
#define ull uint64_t
#define ll long long int
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define vi vector<int>
#define ff first
#define ss second
#define mx5 100005
#define mx52 200005
#define mx6 1000005
#define mod 1000000007
#define smod 998244353
#define nfs                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
using namespace std;

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

template <typename T>
bool MinPlace(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool MaxPlace(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename S, typename T>
ostream &operator<<(ostream &out, const pair<S, T> &p)
{
    out << "{" << p.ff << ", " << p.ss << "}";
    return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v)
{
    out << "[";
    for (int i = 0; i < (int)v.size(); i++)
    {
        out << v[i];
        if (i != (int)v.size() - 1)
            out << ", ";
    }
    out << "]";
    return out;
}

ll p5 = 100000;
ll get_prev(ll cur, ll x, int t)
{
    switch (t)
    {
    case 1:
        return cur - ceil(x / ((double)p5));
        break;
    case 2:
        return (1ll * p5 * cur) / x;
        break;
    default:
        return 0;
        break;
    }
}

ll get_next(ll cur, ll x, int t)
{
    switch (t)
    {
    case 1:
        return cur + ceil(x / ((double)p5));
        break;
    case 2:
        return 1ll * (ceil(x * cur / ((double)p5)));
        break;
    default:
        return 0;
        break;
    }
}

int main()
{
    nfs;
    int n, m;
    cin >> n >> m;
    vi gotcha(m + 1, -1);
    gotcha[0] = 0;

    for (int i = 0; i < n; i++)
    {
        int t, y;
        ll x;

        cin >> t >> x >> y;
        vi left(m + 1, y);
        for (int j = 1; j <= m; j++)
        {
            if (gotcha[j] != -1)
                continue;

            ll prev = get_prev(j, x, t);
            if (prev >= 0 and gotcha[prev] != -1 and left[prev] and get_next(prev, x, t) == j)
            {
                gotcha[j] = i + 1;
                left[j] = left[prev] - 1;
            }
        }
    }
    for (int i = 1; i <= m; i++)
        cout << gotcha[i] << " ";
};