PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000333. Trò chơi chia số (Dividing Game)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Trò chơi chia số (Dividing Game)

Dividing Game

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

There are NN positive integers A1,…,ANA_1,\dots,A_N, all at least 22. Anna and Bruno alternate moves, with Anna playing first.

On each turn, the player chooses an index ii and replaces AiA_i with a proper positive divisor xx: x∣Aix\mid A_i and x≠Aix\ne A_i. Choosing x=1x=1 is allowed when Ai>1A_i>1.

A player who cannot move loses. Assuming both players play optimally, determine the winner.

Input

The first line is NN; the second line contains NN integers AiA_i.

Output

Print exactly Anna or Bruno.

Subtasks

  • Subtask 1 (20 points): 1≤N≤121\le N\le 12, 2≤Ai≤1002\le A_i\le100.
  • Subtask 2 (30 points): 1≤N≤20001\le N\le 2000, 2≤Ai≤1042\le A_i\le 10^4.
  • Subtask 3 (50 points): 1≤N≤1051\le N\le 10^5, 2≤Ai≤1052\le A_i\le 10^5.

Examples

Example 1

Input

3
2 3 4

Output

Anna

Explanation

Counting prime factors with multiplicity gives 1,1,21,1,2 for 2,3,42,3,4. Their XOR is 1⊕1⊕2=2≠01\oplus1\oplus2=2\ne0, so Anna wins.

Example 2

Input

4
2 3 4 6

Output

Bruno

Explanation

The prime-factor counts of 2,3,4,62,3,4,6 are 1,1,2,21,1,2,2 and their XOR is 00. Bruno wins with optimal play.

Note: Each input file contains one case using the specified format.