Beverages
Dilbert has just finished college and decided to go out with friends. Dilbert has some strange habits and thus he decided to celebrate this important moment of his life drinking a lot. He will start drinking beverages with low alcohol content, like beer, and then will move to a beverage that contains more alcohol, like wine, until there are no more available beverages. Once Dilbert starts to drink wine he will not drink beer again, so the alcohol content of the beverages never decreases with the time.
You should help Dilbert by indicating an order in which he can drink the beverages in the way he wishes.
Input
Each test case starts with , the number of available beverages. Then will follow lines, informing the name of each beverage, a name has less than characters and has no white spaces. Then there is another line with an integer and lines in the form will follow, indicating that beverage has more alcohol that beverage , so Dilbert should drink beverage before he starts drinking beverage . Be sure that this relation is transitive, so if there is also a relation you should drink before you can drink . There is a blank line after each test case. In the case there is no relation between two beverages Dilbert should start drinking the one that appears first in the input. The input is terminated by end of file (EOF).
Output
For each test case you must print the message: "Case #C: Dilbert should drink beverages in this order:
."
, where is the number of the test case, starting from , and is a list of the beverages such that the alcohol content of beverage is not less than the alcohol content of beverage . After each test case you must print a blank line.