Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/bit-nim-oyini

The game of Nim

Medium 1000 ms 128 MB 62%
Share

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.

Three piles of stones; the binary representations of their sizes one under another and their XOR

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

Sign in to submit a solution

Signing up is free and takes a minute.