Yet Satisfiability Again

No attempts yetTime limit1sMemory limit256 MB

Problem

Alice recently started working at a hardware design company. One of her jobs is finding defects in fabricated integrated circuits, and that check reduces to deciding whether a single logical formula is satisfiable.

The formula is given in conjunctive normal form. The variables are X1X_1 through XnX_n. A literal is a variable XiX_i or its negation Xi\sim X_i. A clause is a disjunction of literals, and the formula is the conjunction of all mm clauses.

Write a program that decides whether true and false can be assigned to the variables so that every clause is true at the same time.

Input

The first line contains the number of test cases TT. TT is not more than 5.

The first line of each test case contains the number of variables nn and the number of clauses mm (1n201 \le n \le 20, 1m1001 \le m \le 100). Then mm lines follow, one clause per line.

Each clause is a disjunction of literals. A literal is XiX_i or Xi\sim X_i with 1in1 \le i \le n. The disjunction operator is written as the character v and is separated from the literal on either side by a single space. The same variable may appear more than once in one clause, and both polarities of one variable may appear together.

Output

For each test case, print satisfiable on its own line if some assignment makes every clause true, and unsatisfiable otherwise.