cho.sh
Notes
Loading...

Multiplication Game

Time limit

2s

Memory limit

128 MB

Problem

Nils and Mikael play a game with one real number X and K cards. The number satisfies 1 < X < 10,000, and each card contains a positive real number at most 0.9.

The players alternate turns, with Nils moving first. On a turn, the player must choose one card and multiply the current value of X by the number on that card. Cards are not consumed, so the same card may be chosen any number of times.

The first player who makes X less than or equal to 1 wins. Assuming both players always choose optimally, determine the winner.

Floating-point computations can introduce rounding error, but the test data avoids cases where a tiny perturbation of the input would change the answer.

Input

The first line contains the number of data sets T, where 1 ≤ T ≤ 55.

Each of the next T lines describes one data set. A line contains the real number X, the integer K, followed by the K real numbers written on the cards. 1 ≤ K ≤ 6, and every real number in the input has at most 6 significant digits.

Output

For each data set, print the winner's name, either Nils or Mikael, on its own line.