It’s dangerous to eat in a canteen — you may be poisoned by a not fresh food. One may fall into a coma because of the canteen’s chicken and the other feels OK. And vice versa. The food is cooked from M different food stuffs. There are N different food stuffs in the menu but not all of them are at the distribution. Assume that K + 1 students eat the food and we know for each student what products may poison him. The first student eats and he is not poisoned. How the dinner affect on the other students?
The first line contains an integer N (1 ≤ N ≤ 100). The next N lines contain the food stuffs names — non-empty sequences of Latin letters and digits with length not more than 40 symbols. Then there is a number K (1 ≤ K ≤ 100) and K + 1 blocks describing the menu food stuffs dangerous for the canteen visitors afterwards. The ith block starts with a line with an integer Ni — an amount of dangerous food stuffs and then there are Ni lines with the names of those dangerous stuffs (0 ≤ Ni ≤ N). The first block describes the food stuffs dangerous for the first student, the next K blocks — for the rest ones. The input ends with the line containing an integer M (0 ≤ M ≤ N).
lines — the ith
line should contain:
- YES, if the dinner is harmless for the (i + 1)st student,
- NO, if among the food stuffs there is a dangerous one for the (i + 1)st student,
- MAYBE, if there may be different situations under the given conditions.
Problem Author: Pavel Egorov
Problem Source: USU Junior Championship March'2005