Problem: You have a malfunctioning microwave in which you want to put some bananas. You have n time-steps before the microwave stops working completely. At each time-step, it displays a new operation.

Let k be the number of bananas in the microwave currently. Initially, k = 0. In the i-th operation, you are given three parameters t_i, x_i, y_i in the input. Based on the value of t_i, you must do one of the following:

Type 1: (t_i=1, x_i, y_i) — pick an a_i, such that 0 ≤ a_i ≤ y_i, and perform the following update a_i times: k:=⌈ (k + x_i) ⌉.

Type 2: (t_i=2, x_i, y_i) — pick an a_i, such that 0 ≤ a_i ≤ y_i, and perform the following update a_i times: k:=⌈ (k ⋅ x_i) ⌉.

Note that x_i can be a fractional value. See input format for more details. Also, ⌈ x ⌉ is the smallest integer ≥ x.

At the i-th time-step, you must apply the i-th operation exactly once.

For each j such that 1 ≤ j ≤ m, output the earliest time-step at which you can create exactly j bananas. If you cannot create exactly j bananas, output -1.

Input

The first line contains two space-separated integers n (1 ≤ n ≤ 200) and m (2 ≤ m ≤ 10^5).

Then, n lines follow, where the i-th line denotes the operation for the i-th timestep. Each such line contains three space-separated integers t_i, x'_i and y_i (1 ≤ t_i ≤ 2, 1≤ y_i≤ m).

Note that you are given x'_i, which is 10^5 ⋅ x_i. Thus, to obtain x_i, use the formula x_i= \dfrac{x'_i} {10^5}.

For type 1 operations, 1 ≤ x'_i ≤ 10^5 ⋅ m, and for type 2 operations, 10^5 < x'_i ≤ 10^5 ⋅ m.

Output

Print m integers, where the i-th integer is the earliest time-step when you can obtain exactly i bananas (or -1 if it is impossible).

Examples

Input


3 20
1 300000 2
2 400000 2
1 1000000 3


Output


-1 -1 1 -1 -1 1 -1 -1 -1 3 -1 2 3 -1 -1 3 -1 -1 -1 3 


Input


3 20
1 399999 2
2 412345 2
1 1000001 3


Output


-1 -1 -1 1 -1 -1 -1 1 -1 -1 3 -1 -1 -1 3 -1 2 -1 3 -1 

Note

In the first sample input, let us see how to create 16 number of bananas in three timesteps. Initially, k=0.

  * In timestep 1, we choose a_1=2, so we apply the type 1 update — k := ⌈(k+3)⌉ — two times. Hence, k is now 6. 
  * In timestep 2, we choose a_2=0, hence value of k remains unchanged. 
  * In timestep 3, we choose a_3=1, so we are applying the type 1 update k:= ⌈(k+10)⌉ once. Hence, k is now 16. 



It can be shown that k=16 cannot be reached in fewer than three timesteps with the given operations.

In the second sample input, let us see how to create 17 number of bananas in two timesteps. Initially, k=0.

  * In timestep 1, we choose a_1=1, so we apply the type 1 update — k := ⌈(k+3.99999)⌉ — once. Hence, k is now 4. 
  * In timestep 2, we choose a_2=1, so we apply the type 2 update — k := ⌈(k⋅ 4.12345)⌉ — once. Hence, k is now 17. 



It can be shown that k=17 cannot be reached in fewer than two timesteps with the given operations.

Solution (in CPP):

Solution:
#include "bits/stdc++.h"
/*
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
//ordered_set p; 
//p.find_by_order(3)
//p.order_of_key(6)
*/
//#include <algorithm>
#define sz(x)             (int)((x).size())
#define int long long
#define ll long long 
#define mod 1000000007
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define umap unordered_map
#define uset unordered_set
#define lb lower_bound
#define ub upper_bound
#define endll "\n";
#define all(x) (x).begin(), (x).end()
#define forr(it,x) for(auto it=x.begin();it!=x.end();it++)
#define for1(i,a,b) for(int i=a;i<b;i++)
#define for2(i,a,b) for(int i=a;i>=b;i--)
#define for3(i,a,b) for(long long int i=a;i<b;i++)
#define for4(i,a,b) for(long long int i=a;i>=b;i--)
#define pp pair<int,int>
#define ld long double
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpp vector<pp>
#define vi vector<int>
#define vpll vector<pll>
#define vld vector<ld>
#define vvld vector<vld>
#define vvi vector<vi>
#define vvll vector<vll>
#define vvpll vector<vpll>
#define vvpp vector<vpp>
#define I insert
#define mem(a,x) memset(a,x,sizeof(a))
#define p_queue(a) priority_queue<a,vector<a>,greater<a>>
using namespace std;
//const int dx[8]={1,0,-1,0,1,1,-1,-1},dy[8]={0,1,0,-1,-1,1,-1,1};
//const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1}; 
const int N=1e5;
const int INF = 1e9+5;
/*vector<bool> p(N+1, true);
void sieve()
{
  p[0] = p[1] = false;
  int i,j;
  for (i = 2; i*i <= N; i++) 
  {
      if (p[i]) 
      {
          for (j = i * i; j <=N; j += i)
            {
        p[j] =false;
        }
      }
  }
}*/
/*ll power(ll a1, ll b1){
    ll res = 1;
    while(b1 > 0){
        if(b1 % 2){
            res = 1LL * res * a1 % mod;
        }
        a1 = 1LL * a1 * a1 % mod;
        b1 /= 2;
    }
    return res;
}
ll invmod(ll a1,ll b1){
  return power(a1,b1-2);
}*/
/*ll ncr(int n1,int c1){
  if(n1<c1)
    return 0;
  if(n1==c1||c1==0)
    return 1;
  ll n=n1,c=c1;
  vll fact(n+1,1);
  for1(i,1,n+1){
    fact[i]=fact[i-1];
    fact[i]*=i;
    fact[i]%=mod;
  }
  ll fact1=fact[n];
  ll fact2=fact[c];
  ll fact3=fact[n-c];
  fact1*=invmod(fact2,mod);fact1%=mod;
  fact1*=invmod(fact3,mod);fact1%=mod;
  return fact1;
}*/
/*int c[N];
void generate(){
  for1(i,1,N) c[i]=i;
  for1(i,2,N){
    if(c[i]==i){
      for(int j=i;j<N;j+=i){
        if(c[j]==j){
          c[j]/=i;
        }
      }
    }
  }
}*/
/*int gcd(int a,int b){
    if(a<b) swap(a,b);
    if(b==0) return a;
    a%=b;
    return gcd(b,a);
}*/
/*int lcm(int a,int b){
   return (a*1LL*b)/gcd(a,b);
}*/
int a[N];
int cnt1(int ind,int x1){
  int x=ind+x1/N;
  if(x1%N){
    x++;
  }
  return x;
}
int cnt2(int ind,int x1){
  int x=ind*x1;
  int ans=x/N;
  if(x%N)
    ans++;
  return ans;
}
int32_t main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    //cout<<cnt1(0,300000)<<endll;
    int n,m;cin>>n>>m;
    vi dp(m+1,-1),temp(m+1,-1);dp[0]=0;temp[0]=0;
    for1(i,1,n+1){
      int tt,x1,y;cin>>tt>>x1>>y;
      for1(j,0,m+1){
        if(dp[j]!=-1){
          int ind=j,cnt=0;
          if(tt==1){
             while(cnt<y&&cnt1(ind,x1)<=m&&temp[cnt1(ind,x1)]==-1){
               ind=cnt1(ind,x1);temp[ind]=i;cnt++;
             }
          }
          else{
             while(cnt<y&&cnt2(ind,x1)<=m&&temp[cnt2(ind,x1)]==-1){
               ind=cnt2(ind,x1);temp[ind]=i;cnt++;
             }
          }
        }
      }
      dp=temp;
    }
    for1(i,1,m+1) cout<<dp[i]<<" ";
    cout<<endll;
    return 0;
}

/*

*/