
With the recent stock market crash, gas stations in Gabrovo have fallen into crisis. Kyusho regularly fills up his car in Gabrovo, but with today’s increased gas prices, he has no choice but to use public transportation. Faced with such a difficult choice, Kyusho set out to fix the situation.
There are gas stations in Gabrovo in total, numbered from to , with bidirectional streets, each of which connecting two different gas stations. There is at most one street between each pair of gas stations. From each gas station, you can reach any other by moving along the streets. Each gas station has a fuel balance — an integer (it is possible for the balance to be negative). From time to time, a gas station drains fuel from all its neighbors (those to which there is a direct street), thus increasing its balance by , where is the number of neighboring gas stations. In the same time, their balance decreases by one (even if it is already negative).
Kyusho knows that the people of Gabrovo will continue to pump fuel from each other until they all end up with a non-negative balance. Using his connections, he can convince each of them to rob his neighbors a certain number of times. But that’s where the problem comes in — Kyusho is not sure how to end up with no gas stations with a negative balance.
Task
Help Kyusho by writing a program that, given a map of gas stations and their balances, finds what instructions Kyusho should give.
Input data
The first line of the standard input contains two natural number and — the number of gas stations and the number of bidirectional streets between them. The next line contains space-separated integers — the balances of the gas stations. Еach of the the last lines contains two different numbers and , indicating that there is a street between gas stations with numbers and .
Output data
If no solution exists, print Impossible on the only line of standard output. Otherwise, print Possible on the first line. On the next line print integers , separated by a space — how many times each of the gas stations must drain its neighbors so that in the end they all have a non-negative balance. Your solution is considered correct if in the end each gas station has a non-negative balance and for every it is satisfied that .
Constraints and clarifications
- ,
- From each gas station you can reach any other by moving along the streets.
| Subtask | Points | Required subtasks | Other constraints | ||
|---|---|---|---|---|---|
| 0 | 0 | — | — | — | The example test cases. |
| 1 | 5 | — | All streets are between gas stations with consecutive numbers and for each . | ||
| 2 | 12 | — | All streets are between gas stations with consecutive numbers. | ||
| 3 | 7 | — | All gas stations apart from one have exactly one neighboring gas station. | ||
| 4 | 15 | — | — | ||
| 5 | 12 | 2, 4 | — | ||
| 6 | 14 | 1–5 | — | ||
| 7 | 16 | — | |||
| 8 | 13 | 2, 4, 5, 7 | — | ||
| 9 | 6 | 0–8 | — |
Example 1
stdin
7 6
-4 -3 6 0 4 -7 5
2 1
1 3
1 4
4 5
4 6
6 7
stdout
Possible
6 9 0 4 0 6 1
Explanation
Gas station robs its neighbors times, increasing its balance by , but it is also robbed times, making its final balance equal to . All other gas stations are left with zero balance.
Illustration of the gas stations and initial balances:

Example 2
stdin
7 7
0 1 -1 4 -3 -1 1
1 2
2 3
3 4
4 5
5 1
1 6
4 7
stdout
Possible
4 3 3 1 4 5 0
Explanation
After following Kyusho’s instructions, all gas stations have a balance of , except for the one with number , which has a balance of .
Example 3
stdin
3 3
1 0 -1
1 2
2 3
1 3
stdout
Impossible
Explanation
No matter how gas stations rob each other, they will always never all have a nonnegative balance.