eolymp
bolt
Try our new interface for solving problems
Problems

Orange mood

Orange mood

Once the club president of the European level, "Nader" has announced that from next season, the Dutch coach who has won the respect of fans, can replace less successful Italian. When I heard about it, outraged fans of the club went to the palace of the president, in order to perpetrate an orange (the color of the Dutch national team shirts) revolution and return to the coach. It turned out that the Presidential Guard also rooting for "Nadir"... The president is in the palace, which consists of many rooms and corridors connecting them. Two different rooms can be connected by no more than one corridor. At both ends of each corridor is a door. Some doors have a deadbolt that can lock or unlock from inside the room. Locked deadbolt locks access to the room from the corridor. Through some of the rooms (inputs) to the palace can be reached from the outside. Initially, all doors are open. Your task is to determine whether the president to choose a room to shelter from outraged fans, so that, starting from the room, he could walk the corridors of the palace, close the door part and then go back to their hideout so that access to him outside the palace was closed. \InputFile The first line contains three integers \textbf{N}, \textbf{M}, \textbf{P} - number of rooms of the palace, the number of corridors and entrances to the palace (\textbf{1} ≤ \textbf{N} ≤ \textbf{10000}, \textbf{0} ≤ \textbf{M} ≤ \textbf{1000000}, \textbf{1} ≤ \textbf{P} ≤ \textbf{N}). The second line contains the numbers \textbf{P} - number of rooms through which you can get into the palace. The following \textbf{M} lines describes the corridors of the palace. Each corridor is defined by a pair of integers from \textbf{1} to \textbf{N} - number of rooms it connects. Next N lines are in the description of rooms - the number of \textbf{P_i} - \textbf{P_i} and the number of numbers - numbers of corridors, a door which can be locked while in the room (\textbf{0} ≤ \textbf{P_i} ≤ \textbf{100}). Rooms and corridors are numbered by integers, starting with units in their order of appearance in the input file. \OutputFile In the output file you want to display a single number - the number of rooms of the palace in which the president can escape. If these numbers somewhat, to bring the smallest of them. If you can not hide, to withdraw the phrase"\textbf{Impossible}" (no quotes).
Time limit 2 seconds
Memory limit 64 MiB
Input example #1
4 3 1
1
1 2
2 3
3 4
0
0
1 2
0
Output example #1
3