Courses

아직 제출이 없습니다시간 제한15초메모리 제한1024 MB

문제

Little Misha wants to change his IQ (initially he has 00 IQ). He found mm types of courses on the internet. The ii-th course type costs c_ic\_i bitcoins, changes his IQ by d_id\_i (d_id\_i can be negative, that is, his IQ can decrease after a course), and there are n_in\_i different courses of ii-th type. Authors of courses want to earn money, so c_id_ic\_i \ge \lvert d\_i \rvert.

Misha wants to reach at least kk IQ (of course, kk can be negative). In order to achieve his goal, he will take a single course every day till some day. A course could be taken multiple times and each time it will affect Misha's IQ.

Now, he has nn bitcoins. He is wondering: in how many ways can he spend exactly tt bitcoins and reach at least kk IQ in the end, for each 1tn1 \le t \le n? Two ways are considered different if they differ in the number of days to study or in a course taken at some day (different courses of the same type are considered different as well).

입력

The first line contains a single integer mm (0<m<1000 < m < 100): the number of types of courses.

Each of the next mm lines contains three integers c_ic\_i, d_id\_i, n_in\_i (0<c_i<100 < c\_i < 10, d_ic_i\lvert d\_i \rvert \le c\_i, 0n_i1040 \le n\_i \leq 10^4).

And finally, the last line contains two integers nn and kk (kn3104\lvert k \rvert \leq n \le 3 \cdot 10^4, n>0n > 0).

출력

Output nn integers, each on a separate line. The number on the ii-th line should be the number of ways to spend exactly ii bitcoins and obtain at least kk IQ. Since these numbers can be large, output them modulo 998,244,353998\\,244\\,353.