Labyrinth

아직 제출이 없습니다시간 제한3초메모리 제한512 MB

문제

Leslie and Leon entered a labyrinth. The labyrinth consists of nn halls and mm one-way passages between them. The halls are numbered from 11 to nn.

Leslie and Leon start their journey in the hall ss. Right away, they quarrel and decide to explore the labyrinth separately. However, they want to meet again at the end of their journey.

To help Leslie and Leon, your task is to find two different paths from the given hall ss to some other hall tt, such that these two paths do not share halls other than the staring hall ss and the ending hall tt. The hall tt has not been determined yet, so you can choose any of the labyrinth's halls as tt except ss.

Leslie's and Leon's paths do not have to be the shortest ones, but their paths must be simple, visiting any hall at most once. Also, they cannot visit any common halls except ss and tt during their journey, even at different times.

입력

The first line contains three integers nn, mm, and ss, where nn (2n21052 \le n \le 2 \cdot 10^5) is the number of vertices, mm (0m21050 \le m \le 2 \cdot 10^5) is the number of edges in the labyrinth, and ss (1sn1 \le s \le n) is the starting hall.

Then mm lines with descriptions of passages follow. Each description contains two integers u_iu\_i, v_iv\_i (1u_i,v_in1 \le u\_i, v\_i \le n; u_iv_iu\_i \neq v\_i), denoting a passage from the hall u_iu\_i to the hall v_iv\_i. The passages are one-way. Each tuple (u_i,v_i)(u\_i, v\_i) is present in the input at most once. The labyrinth can contain cycles and is not necessarily connected in any way.

출력

If it is possible to find the desired two paths, output "Possible", otherwise output "Impossible".

If the answer exists, output two path descriptions. Each description occupies two lines. The first line of the description contains an integer hh (2hn2 \le h \le n) --- the number of halls in a path, and the second line contains distinct integers w_1,w_2,,w_hw\_1, w\_2, \dots, w\_h (w_1=sw\_1 = s; 1w_jn1 \le w\_j \le n; w_h=tw\_h = t) --- the halls in the path in the order of passing. Both paths must end at the same vertex tt. The paths must be different, and all intermediate halls in these paths must be distinct.