385 传统题

[ABC368F] 因数分解博弈 (Dividing Game)

时间限制
2000ms
内存限制
1024MiB
登顶 / 尝试
0/ 0
难度
5
    上传者 标签AtCoderABC368提高-博弈论SG函数数论

[ABC368F] 因数分解博弈 (Dividing Game)

Score : 475475 points

Problem Statement

You are given a sequence of NN positive integers A=(A1,A2,…,AN)A = (A_1, A_2, \dots ,A_N), where each element is at least 22. Anna and Bruno play a game using these integers. They take turns, with Anna going first, performing the following operation.

  • Choose an integer i (1≤i≤N)i \ (1 \leq i \leq N) freely. Then, freely choose a positive divisor xx of AiA_i that is not AiA_i itself, and replace AiA_i with xx.

The player who cannot perform the operation loses, and the other player wins. Determine who wins assuming both players play optimally for victory.

Constraints

  • 1≤N≤1051 \leq N \leq 10^5

  • 2≤Ai≤1052 \leq A_i \leq 10^5

  • All input values are integers.

Input

The input is given from Standard Input in the following format:

$N$
$A_1$ $A_2$ $\cdots$ $A_N$

Output

Print Anna if Anna wins the game, and Bruno if Bruno wins.

Sample Input 1

3
2 3 4

Sample Output 1

Anna

For example, the game might proceed as follows. Note that this example may not necessarily represent optimal play by both players:

  • Anna changes A3A_3 to 22.

  • Bruno changes A1A_1 to 11.

  • Anna changes A2A_2 to 11.

  • Bruno changes A3A_3 to 11.

  • Anna cannot operate on her turn, so Bruno wins.

Actually, for this sample, Anna always wins if she plays optimally.

Sample Input 2

4
2 3 4 6

Sample Output 2

Bruno