~/algor $ cat problems/bit-nim-oyini
The game of Nim
Medium
1000 ms
128 MB
62%
There are $n$ piles of stones on the table, the $i$-th pile has $a_{i}$ stones. Two players move in turn, the first player starts. On a move a player chooses one pile and takes any number of stones from it (at least one). The player who takes the last stone wins. Who wins if both play optimally? If the first player wins, print BIRINCHI, otherwise IKKINCHI.
Input
The first line contains a positive integer $n$. The second line contains $n$ positive integers $a_{i}$.
Output
BIRINCHI or IKKINCHI.
Note
$1 \le n \le 10^{5}$
$1 \le a_{i} \le 10^{9}$
Examples
Input #1
3 3 4 5
Output #1
BIRINCHI
Input #2
2 6 6
Output #2
IKKINCHI