{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"![Explosion](CDN_BASE_URL/661b58f9dd52365c64f295f604602f1e?v\u003d1715628330)\n\nPlanet Krypton is about to explode. The inhabitants of this planet have to leave the planet immediately. But the problem is that, still some decisions have to be made - where to go, how to go etc. So, the council of Krypton has invited some of the people to meet in a large hall.There are **n** people in planet Krypton, for simplicity they are given ids from **1** to **n**. The council uses a super computer named Oracle to call them in the meeting. Oracle has four types of messages for invitation.\n\nThe message format is **type x y**, where **x** and **y** are two different person\u0027s ids and **type** is an integer as follows:\n\n1. **1 x y** means that either **x** or **y** should be present in the meeting.\n2. **2 x y** means that if **x** is present, then no condition on **y**, but if **x** is absent **y** should be absent.\n3. **3 x y** means that either **x** or **y** must be absent.\n4. **4 x y** means that either **x** or **y** must be present but not both.\n\nEach member of the council has an opinion too. The message format is **type x y z**, where **x, y** and **z** are three different person\u0027s ids and **type** is an integer as follows:\n\n1. **1 x y z** means that at least one of **x, y** or **z** should be present.\n2. **2 x y z** means that at least one of **x, y** or **z** should be absent.\n\nNow you have to find whether the members can be invited such that every message by oracle and the council members are satisfied."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 200)**, denoting the number of test cases.\n\nEach case starts with a blank line. Next line contains three integers **n, m** and **k (3 \u0026le; n \u0026le; 1000, 0 \u0026le; m \u0026le; 2000, 0 \u0026le; k \u0026le; 5)** where **m** means the number of messages by oracle, **k** means the total members in the council. Each of the next **m** lines will contain a message of Oracle in the format given above. Each of the next **k** lines will contain a message of a council member. You can assume that all the ids given are correct."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and whether it\u0027s possible to invite the people such that all the messages are satisfied. If it\u0027s not possible, then print `Impossible.` in a single line. Otherwise, print `Possible` and the number of invited people and the ids of the invited people in ascending order. Print the line leaving a single space between fields. Terminate this line with a `.`. See the samples for more details. There can be multiple answers; print any valid one."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n\n3 2 1\n3 2 1\n1 2 3\n1 1 2 3\n\n4 4 1\n2 2 1\n4 1 2\n4 1 3\n4 1 4\n2 2 3 4\n\n4 5 0\n3 1 2\n2 2 3\n2 2 4\n2 1 2\n2 2 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: Possible 2 1 3.\nCase 2: Impossible.\nCase 3: Possible 0.\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"This is a special judge problem; wrong output format may cause \u0027Wrong Answer\u0027."}}]}