Anybody who has been to a child's birthday party has seen the following scene:
Parent: OK kids, what do you want to drink,
Cokeorchocolate milk?Jamie: Coke.
John: I hate Coke.
Mary: I want what John is having.
Barry: Ick! Then I don't want it if she's going to have it.
… etc.
This is a big party. 1000 people have been invited and nearly that many may show up. Can you make everybody happy?
The input may contain several test cases. The first line of each test case is an integer $N$, the number of requests that must be satisfied. The next $N$ lines each contain one request, in one of the following five formats:
<person> wants <drink>
<person> hates <drink>
<person> wants same as <person>
<person> wants different from <person>
<person> wants <drink> if <person> gets <drink>
<person> is the name of a person — up to 20 lower-case letters. <drink> is either Coke or chocolate milk.
Each request means:
<person> wants <drink>: that person must get that drink.<person> hates <drink>: that person must not get that drink (so they get the other one).A wants same as B: A and B must get the same drink.A wants different from B: A and B must get different drinks.A wants X if B gets Y: if B gets Y, then A must get X.The input ends with a line whose value of $N$ is 0.
For each test case, if everybody can be made happy, print one line per person, in alphabetical order of their names, in the format:
<person> gets <drink>
If there is more than one way to make everybody happy, fill the glasses in alphabetical order and pour Coke whenever there is a choice (it is cheaper) — that is, print the assignment uniquely determined by this rule.
If it is not possible to make everybody happy, print the single line:
Everybody gets water
Separate the outputs of two consecutive test cases with a single blank line.