eolymp
bolt
Try our new interface for solving problems
Problems

Cleopatra's Circlet

Cleopatra's Circlet

Anya is a passionate lover of jewelry. Her collection includes many diamonds, emeralds and adamants.

... Urgent news! Cleopatra's priceless serpentine ruby was stolen!

Three days ago, the world was shocked by the sensational news: a research expedition found a secret room in one of the temples built during the times of the great Egyptian empress Cleopatra. In it, in addition to the bronze statue of the empress, a strikingly beautiful tiara was discovered, which was previously considered to be completely lost! Scientists have reported that the diadem is topped with a scarlet a - carat ruby ​​in the shape of a snake head. However, literally a couple of hours ago, the news arrived that the priceless jewelry had been mutilated: someone had crept into the tiara's storage room and cut out a ruby ​​from it! Police establish a circle of suspects ...

Hearing about the theft of a ruby, Anya immediately rushed to investigate information in the black markets. During the day, she discovered n announcements about the sale of a ruby in the form of a snake head, claiming that this is exactly the stolen ancient value. Anya will not forgive herself if she misses such an invaluable exhibit for her collection, so she ordered her assistant Gleb to urgently buy all these stones, hoping to acquire a real relic among them.

Having bought all n stones, Gleb immediately made several test measurements, weighed some sets of them, and sent the results to Anya by e-mail. In the meantime, she consulted with the famous antiquity researcher Andre Shesto-Mert about the stolen jewel and learned that, according to all available historical sources, the ruby weighed not a carat, as the journalists claimed, but b carat!

Knowing the results of Gleb's weighings, and considering that all fake stones weigh a carats, and only a real serpentine ruby can weigh b carats, determine which of the stones purchased may actually be the lost relic of the great empress of the past .

Input

The first line contains four integers n, a, b and k (1n200, 1a, b106, ab, 1k1000).

Next k lines describe the weighting carried out by Gleb.

The first number in the i-th description is wi (1wi200 000 000), the total weight of the group of stones that participated in i - th weighing.

The second number is mi (1min) - the number of stones involved in the i-th weighing. Then follow mi integers sorted in ascending order — the numbers of the stones that participated in i-th weighing.

Output

If there are no snake ruby stones among Gleb's bought, print the string "Fail" (without quotes).

If the stolen ruby can be present among the stones, then print in the first line the number of all possible candidates for the role of an ancient relic, and in the second line - the numbers of possible options. You can print numbers in any order.

If Gleb at some point was mistaken in the calculations, and the information on weighings sent to them cannot correspond to reality, output the line "Impossible" (without quotes).

Note

In the first test from the first weighing we conclude that the first and third stones are guaranteed fake. On the other hand, among the second, third and fourth stones there is exactly the real one. It means that the second or fourth stone can be real.

In the second test, Gleb was mistaken in measurements, because from the first two measurements it follows that all the stones are fake, and from the last - that the real stone, however, is among them.

In the third test, the results clearly indicate that both acquired stones are fake.

Time limit 1 second
Memory limit 128 MiB
Input example #1
4 15 17 2
30 2 1 3
47 3 2 3 4
Output example #1
2
2 4 
Input example #2
3 15 17 3
30 2 1 2
30 2 2 3
47 3 1 2 3
Output example #2
Impossible
Input example #3
2 1 2 2
1 1 2
1 1 1
Output example #3
Fail
Source 2013 Moscow city informatics olympiad for 6-9 classes, Moscow, February 3, Problem D