The Cows have built a randomized stink bomb to drive the Piggies out of their land. The Piggy civilization has $N$ cities, numbered $1$ through $N$, connected by $M$ bidirectional roads. Each road joins two different cities, and city $1$ is guaranteed to be connected to at least one other city.
The stink bomb is placed in city $1$. Every hour — including the very first one — the bomb sits in some city and does exactly one of two things:
Because the bomb wanders at random, the Cows want to know, for every city, the probability that the bomb eventually detonates there (polluting it).
For example, suppose there are two cities joined by a single road, and the bomb — starting in city $1$ — detonates with probability $\frac{1}{2}$ each time it enters a city:
1--2
Writing each possible journey as the sequence of cities the bomb visits (it detonates in the last city listed), the journeys are:
1
1-2
1-2-1
1-2-1-2
1-2-1-2-1
...
The bomb detonates in city $1$ exactly on the journeys that pass through an odd number of cities (1; 1-2-1; 1-2-1-2-1; and so on). A journey through $k$ cities occurs with probability $\left(\frac{1}{2}\right)^k$: the bomb must fail to detonate in each of the first $k-1$ cities (probability $1-\frac{1}{2}=\frac{1}{2}$ each) and then detonate in the $k$-th (probability $\frac{1}{2}$). Summing the odd-numbered terms gives the probability of detonating in city $1$:
$$\frac{1}{2} + \left(\frac{1}{2}\right)^3 + \left(\frac{1}{2}\right)^5 + \cdots = \frac{2}{3} \approx 0.666666667$$
so the probability of detonating in city $2$ is $\frac{1}{3} \approx 0.333333333$.
Print $N$ lines. On line $i$, print the probability that city $i$ is polluted, written with exactly $9$ digits after the decimal point.