#include <bits/stdc++.h>

#define endl "\n"

using namespace std;


void setup() {
    #ifdef LOCAL
    freopen("input", "r", stdin);
    #else
    ios::sync_with_stdio(0);
    cin.tie(0);
    #endif
}


int main() {
    setup();
    int n, m;
    cin >> n >> m;
    vector<int> times(m + 1, -1);
    vector<int> usedOn(m + 1);
    times[0] = 0;
    for (int i = 1; i <= n; i++) {
        int t, y;
        long long x;
        cin >> t >> x >> y;
        if (t == 1) {
            x = (x + 99999) / 100000;
            for (int j = 0; j + x <= m; j++) {
                if (times[j] != -1) {
                    if (times[j + x] == -1) {
                        if (times[j] != i || (times[j] == i && usedOn[j] < y)) {
                            times[j + x] = i;
                        }
                        usedOn[j + x] = usedOn[j] + 1;
                    }
                }
            }
        } else {
            for (int j = 1; ; j++) {
                long long nxt = (x * j + 99999) / 100000;
                if (nxt > m) {
                    break;
                }
                if (times[j] != -1) {
                    if (times[nxt] == -1) {
                        if (times[j] != i || (times[j] == i && usedOn[j] < y)) {
                            times[nxt] = i;
                        }
                        usedOn[nxt] = usedOn[j] + 1;
                    }
                }
            }
        }
        for (int i = 0; i <= m; i++) {
            usedOn[i] = 0;
        }
    }
    for (int i = 1; i <= m; i++) {
        cout << times[i] << " ";
    }
    cout << endl;
}
