Number Game

No attempts yetTime limit1sMemory limit128 MB

Problem

Christiane and Matthias are playing a new game called the Number Game. The rules are as follows. The two players take turns choosing an integer greater than or equal to $2$. The numbers that may be chosen are restricted by the rules below.

  • R1. A number that one of the players has already chosen, or any multiple of such a number, cannot be chosen. (A number $z$ is a multiple of a number $y$ if $z = y \cdot x$ for some positive integer $x$.)
  • R2. A sum of two such multiples cannot be chosen either.
  • R3. For simplicity, a number greater than $20$ cannot be chosen either.

The player who cannot choose any number loses the game.

For example, suppose Matthias starts by choosing $4$. Then Christiane can no longer choose $4, 8, 12, \dots$. Suppose she chooses $3$. Now $3, 6, 9, \dots$ are excluded too, and moreover numbers such as $7 = 3 + 4$, $10 = 2\cdot 3 + 4$, $11 = 3 + 2\cdot 4$, $13 = 3\cdot 3 + 4, \dots$ become unavailable. In fact the only numbers left are $2$ and $5$. Matthias now chooses $2$. Since $5 = 2 + 3$ is now forbidden as well, Christiane has no move left and loses.

Thanks to rule R3 the game is always finite and a winning strategy can be found. Given a game position (a list of the numbers that are not yet forbidden), output every winning move. A winning move is a move after which the player to move can force a win no matter how the opponent responds. Formally:

  • A losing position is one in which either (1) all numbers are forbidden, or (2) no winning move exists.
  • A winning position is one in which a winning move exists.
  • A winning move is a move after which the resulting position is a losing position.

Input

The first line contains the number of scenarios.

Each scenario describes one game position. It begins with a line containing an integer $a$ ($0 \le a < 20$), the count of numbers that are still available. The next line contains those $a$ available numbers, separated by single spaces.

You may assume that every position in the input can actually occur in the Number Game (for example, if $3$ is not available, then $6$ is not available either).

Output

For each scenario, first print a line Scenario #i: where $i$ is the scenario number, starting from $1$. On the next line print There is no winning move. if the current position has no winning move; otherwise print The winning moves are: w1 w2 ... wk. where $w_1, w_2, \dots, w_k$ are all winning moves listed in ascending order and separated by single spaces. Separate the output of consecutive scenarios with a single blank line.