#pragma GCC optimize("Ofast")
#pragma GCC optimization ("unroll-loops")
 
#include <bits/stdc++.h>
 
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define ins insert
#define sz(x) (int)x.size()
#define dbg(x) cout << x << "\n";
 
const int N = 1e5;
const long long int mod = 1e9 + 7;
const long long int Mod = 998244353;
const long double Pi = acos(-1);
const long long int Inf = 4e18;
 
using namespace std;
 
void TestCase (){
        long long int n, m, lim = 100000;

        cin >> n >> m;

        vector <long long int> d(m + 1, INT_MAX);
        d[0] = 0;
        
        vector <long long int> v{0};
        
        for(long long int i = 1; i<=n; i++){
                long long int t, x, y;
                cin >> t >> x >> y;

                vector <bool> mark(m + 1, false);
                while(!v.empty()){
                        long long int a = v.back(), lst = a;
                        v.pop_back();
                        for(long long int cur = 0; cur <= y; cur++){
                                if(cur > 0){
                                        if(t == 2) lst = (lst * x + lim - 1)/lim;
                                        else lst = (lst * lim + x + lim - 1)/lim;
                                }
                                if(lst <= m){
                                        if(mark[lst] != true) mark[lst] = true;
                                        else break;
                                }
                                else break;
                        }
                }
                for(long long int j = 0; j<=m; j++){
                        if(mark[j]){
                                v.pb(j);
                                d[j] = min(d[j], i);
                        }
                }
                sort(v.begin(), v.end());
        }

        for(long long int i = 1; i<=m; i++){
                if(d[i] == INT_MAX) d[i] = -1;
        }

        for(long long int i = 1; i<=m; i++) cout << d[i] << " ";
}
 
int main(){
        IOS;
        int T = 1;
        // cin >> T;
        while(T--){
                TestCase();
                cout << "\n";
        }
        return 0;
}