Problem: You have to handle a very complex water distribution system. The system consists of junctions and pipes, -th pipe connects junctions and .
The only thing you can do is adjusting the pipes. You have to choose integer numbers , , ..., and use them as pipe settings. -th pipe will distribute units of water per second from junction to junction (if is negative, then the pipe will distribute units of water per second from junction to junction ). It is allowed to set to any integer from to .
In order for the system to work properly, there are some constraints: for every , -th junction has a number associated with it meaning that the difference between incoming and outcoming flow for -th junction must be exactly (if is not negative, then -th junction must receive units of water per second; if it is negative, then -th junction must transfer units of water per second to other junctions).
Can you choose the integers , , ..., in such a way that all requirements on incoming and outcoming flows are satisfied?
Input Format: The first line contains an integer () — the number of junctions.
The second line contains integers () — constraints for the junctions.
The third line contains an integer () — the number of pipes.
-th of the next lines contains two integers and (, ) — the description of -th pipe. It is guaranteed that each unordered pair will appear no more than once in the input (it means that there won't be any pairs or after the first occurrence of ). It is guaranteed that for each pair of junctions there exists a path along the pipes connecting them.
Output Format: If you can choose such integer numbers in such a way that all requirements on incoming and outcoming flows are satisfied, then output "Possible" in the first line. Then output lines, -th line should contain — the chosen setting numbers for the pipes. Pipes are numbered in order they appear in the input.
Otherwise output "Impossible" in the only line.