Tower Breakers

There are n towers, each initially of height m. Two players take turns. On each turn, a player chooses a tower of height h and reduces it to a divisor of h (strictly smaller than h). The player who makes the last move wins. Both play optimally. Return 1 if the first player wins, 2 if the second player wins.

Every tower is reduced to a proper divisor of its current height, so every tower shrinks and the game always ends. A tower of height one has no proper divisor other than one, and a move must strictly decrease the height, so height one is a terminal tower with no moves.

For heights above one, the player who chooses the tower can drop it straight to one, after which it offers no further moves. That makes each tower with height above one a single-move component, and the player who first touches it ends it for good. With n identical towers, the game reduces to the parity of n: an odd count gives the first player the last move, an even count gives it to the second player. If m equals one, no tower has a legal move and the first player loses immediately.

Examples
Input: [2,2]
Output: 2
Hints

Tower Breakers

There are `n` towers, each initially of height `m`. Two players take turns. On each turn, a player chooses a tower of height `h` and reduces it to a divisor of `h` (strictly smaller than `h`). The player who makes the last move wins. Both play optimally. Return 1 if the first player wins, 2 if the second player wins.