A Modified Game Of Nim

medium
Given an array of integers, two players Alice and Bob are playing a game where Alice can remove any  element from the array that are multiples of 3. Similarly, Bob can remove multiples of 5. The player who can't remove any element loses the game. The task is to find the winner of the game if Alice starts first and both play optimally.

Input Format

The first line contains integer n, no. of integers. second line contains n integers arr[1],arr[2]...arr[n].

Output Format

Print the winner (ALICE or BOB).

Constraints

1<= n <= 10^5
1<= arr[i] <= 10^8

Example

Input
5
15 6 9 10 20
Output
ALICE
Previous
First Move In A Nim Game
Next
Winner In Nim Game

Related Questions