Danger at the Marks


Eric and Lucas are both training for the Olympic sailing regatta, but the venue has only one course. Neither of them is willing to compromise or take turns, so they have to practise in the same space. The danger is at the marks (the inflatable buoys sailors must round), where boats bunch up and can collide. Coach Hung wants them to meet as rarely as possible. Eric always launches from the same mark, while Lucas may start at any other mark, and you have been asked how often they should expect to meet in each case.

The course is laid out around nn marks, numbered from 11 to nn. Wind and currents push sailors between these marks according to fixed patterns.

For every pair of marks ii and jj, you are given an integer wi,jw_{i,j}. At the end of each minute, a sailor currently at mark ii moves to mark jj with probability wi,j100\dfrac{w_{i,j}}{100}. Every row of these values sums to 100100.

Eric and Lucas follow these probabilities independently. Eric always starts at mark 11. Lucas may start at any mark ss except mark 11.

Whenever both of them occupy the same mark after a minute has passed, they are said to have met.

For every starting mark ss of Lucas from 22 to nn, determine the expected number of times the two sailors meet during the next kk minutes.

Because the answers may be fractional, output them modulo 109+710^9+7. If an expected value equals the rational number pq\dfrac{p}{q} in lowest terms, output p⋅q−1(mod109+7)p \cdot q^{-1} \pmod{10^9+7}.

Input

The first line contains two integers nn and kk (2≤n≤1002 \le n \le 100, 1≤k≤10181 \le k \le 10^{18}).

The next nn lines each contain nn integers. The jj-th integer on the ii-th of these lines is wi,jw_{i,j} (0≤wi,j≤1000 \le w_{i,j} \le 100). For every row ii, ∑j=1nwi,j=100\sum_{j=1}^{n} w_{i,j} = 100.

Output

Output a single line containing n−1n-1 integers. The ii-th of these should be the required answer when Lucas starts at mark i+1i+1.

Example 1

Input 1
2 2
80 20
30 70
Output 1
20000001
Explanation

The expected value is 4350\dfrac{43}{50}.

Example 2

Input 2
4 5
40 10 20 30
0 50 50 0
25 25 25 25
10 20 30 40
Output 2
21336070 454089224 404025250

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.

Danger at the Marks - MAPS Online Judge