Model a gym-class game as a random process.
An entertaining game elementary-school children play in gym class works as follows.
How the game is played: the children gather at a fixed starting basket. In turn, each child draws one card at random from the basket, memorizes the destination, and returns the card before the next child draws. When the teacher blows the whistle, every child moves to the basket written on the card they drew.
Given the card composition of each basket, determine the probability that a child is standing at each basket during the first ten steps of the game.
For example, suppose there are four baskets — "tree", "house", "car", and "park" — with the following cards.
As a table:
| basket \ destination | tree | house | car | park |
|---|---|---|---|---|
| tree | 2 | 1 | 2 | 0 |
| house | 1 | 0 | 1 | 2 |
| car | 1 | 0 | 0 | 0 |
| park | 1 | 1 | 1 | 1 |
Everyone starts at the first basket (tree), so initially $P_0(\text{tree}) = 1$ and $P_0 = 0$ for every other basket.
At any later step, the probability of being at a new location equals the sum, over every location, of the probability of being there on the previous step times the probability of moving from that location to the new one. In the example,
$$P_{s+1}(\text{tree}) = 0.40,P_s(\text{tree}) + 0.25,P_s(\text{house}) + 1.00,P_s(\text{car}) + 0.25,P_s(\text{park})$$
(for instance, the chance of going tree to tree is $2/5 = 0.40$, and house to tree is $1/4 = 0.25$).
The game always begins at the first basket.
The input is a table of card counts spanning $N$ lines. Line $i$ contains $N$ integers giving the cards in basket $i$ in destination order; the $j$-th value is how many "go to basket $j$" cards are inside basket $i$.
The number of baskets $N$ equals the number of input lines (and the count of integers per line), with $2 \le N \le 10$. Within one basket there are at most 10 cards for any single destination, and every basket holds at least one card (each line sums to at least 1).
Print exactly 10 lines. Line $s$ (for $s = 0, 1, \dots, 9$) lists the probabilities $P_s(1), P_s(2), \dots, P_s(N)$ that the child is at each basket after $s$ steps, separated by single spaces. The first line is the starting distribution, so the first basket is $1.00000$ and the rest are $0.00000$.
Print each probability rounded to exactly five digits after the decimal point (e.g. 1.00000). Performing the internal computations in double-precision arithmetic is recommended.