Despite being a city of opportunity, Gadgetzan is a place where gangs rule the streets. Recently, a group of robbers broke the exterior wall of the First Bank of Gadgetzan and stole several crates of jade antiques. The bank’s owner has just posted an announcement in Gadgetzan Gazette, offering a great quantity of arcane dust and many unused decks for the capture of perpetrators. You, as a famous detective in Gadgetzan, have collected several testimonies from witnesses. Here is how these testimonies may look like.
“Kazakus was not at home on the day of the robbery.”
“If the courier was at home, so was the Kazakus.”
“If Kazakus and the courier were at home that day, then the Kazakus must not be the robber.”
Generically, each testimony is in one of the following four forms:
Unconditional Affirmation This kind of testimony asserts that some proposition is true.
Unconditioanl Denial This kind of testimony asserts that some proposition is false.
Conditional Affirmation This kind of testimony asserts that some proposition is true if several propositions (called the antecedents) are true.
Conditional Denial This kind of testimony asserts that some proposition is false if several propositions are true.
Note that every proposition is either true or false.Having collected these testimonies, you are going to solve the mystery. You want to find out if these testimonies conflict with each other. And if not, you want to figure out the truth of this incidence; that is, you want to identify the truth of each proposition, such that all testimonies are valid.
输入描述:
The first line of input contains a single integer
)
, denoting the number of testimonies, and the number of propositions that may involve in the testimonies. The propositions are numbered

through

.
Unconditional Affirmation The line contains a single integer, the number of the proposition to confirm.
Unconditioanl Denial The line contains a single integer preceded with an exclamation mark (!).
Conditional Affirmation The line starts with a list of integers denoting the numbers of antecedents, followed by the -> symbol, and ends with an integer denoting the proposition to confirm.
Conditional Denial The line starts with a list of integers denoting the numbers of antecedents, followed by the -> symbol, and ends with an integer preceded with an exclamation mark denoting the consequent proposition to deny. Page 1 of 2 Note that there is exactly one space between the numbers and before and after the -> symbol, but there is no space after the exclamation mark.
Then follow

lines, specifying these testimonies. Each line represents a testimony and is in the following format.
It is guaranteed that the antecedents of a conditional testimony are distinct and do not contain the consequent. Also, the total number of antecedents in all conditional testimonies does not exceed

.
输出描述:
If these testimonies conflict with each other, print
in a single line. Otherwise, print
characters without spacing, each being either
(representing true) or
(representing false), denoting the truth assignment to these propositions respecting the testimonies. If there are multiple possible assignments, any assignment is acceptable.
示例2
输入
复制
6 4
1 -> 2
1 3 -> !2
1 -> 3
4 -> 2
1
2 3 4 -> !1