import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; import java.util.Set; /** * 想定誤解 */ public class Yuki103 { boolean[] sieve; int[] memo; final int MAX = 10000; public Yuki103() { Scanner scanner = new Scanner(System.in); memo = new int[MAX + 1]; Arrays.fill(memo, -1); sieve = new boolean[MAX + 1]; Arrays.fill(sieve, true); sieve[0] = false; sieve[1] = false; for (int i = 2; i < sieve.length; i++) { if (!sieve[i]) continue; for (int j = 2 * i; j < sieve.length; j += i) sieve[j] = false; } int N = scanner.nextInt(); int nim = 0; for (int i = 0; i < N; i++) { nim ^= getGrundyNumber(scanner.nextInt()); } //後者必勝 if (nim == 0) { System.out.println("Bob"); } else { System.out.println("Alice"); } } int getGrundyNumber(int M) { if (memo[M] >= 0) { return memo[M]; } Set numbers = new HashSet<>(); for (int k = 2; k <= M; k++) { if (!sieve[k]) { continue; } int m = M; for (int i = 0; m % k == 0; i++) { m /= k; numbers.add(getGrundyNumber(m)); } } int res = 0; for (; numbers.contains(res); res++) { } return memo[M] = res; } public static void main(String[] args) { Yuki103 yuki103 = new Yuki103(); } }