Alice and Bob play a game with N non-negative integers.
Players take successive turns, and in each turn, they are allowed to flip active bits from any of the integers in the list.
That is, they pick one (and only one) non-zero integer in the list and flip its as many active bits as desired.
By flipping an active bit of an integer, we mean turning a bit from 1 to 0 in the binary representation of that integer.
As this flipping continues, eventually all numbers in the list become zero.
So the player who ends up turning the last non-zero integer to 0 in the list is the winner (or the player who cannot play on his turn loses).
Given a possible initial configuration, we need to tell if Alice can or cannot beat Bob. Assume that both of them will play optimally (i.e. they do their best in each turn). Also assume that Alice gets the first turn.
Example : Let N=2 and list be [2,9] then in this Alice will win.But say we have N=3 and list be [8,10,290] then in this Bob will move whatever move Alice takes.
So given list of N numbers we need to find winner of this game.