using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static bool isPrime(int n){ if(n < 2) return false; for(int i = 2; i < n; i++) if(n % i == 0) return false; return true; } static void Main(String[] args) { int g = Convert.ToInt32(Console.ReadLine()); string [] players = new [] { "Alice", "Bob" }; for(int a0 = 0; a0 < g; a0++){ int n = Convert.ToInt32(Console.ReadLine()); if(n < 2) Console.WriteLine(players[1]); else { var temp = new int[n]; var iteration = 0; do{ var p = -1; for(int i = 0; i < temp.Length; i++){ if(temp[i] != -1 && isPrime(i + 1)){ p = i + 1; temp[i] = -1; // Mark as removed. break; } } if(p != -1){ for(int i = 0; i < temp.Length; i++){ if(temp[i] != -1 && (i + 1) % p == 0) temp[i] = -1; } } else{ break; } iteration++; }while(true); Console.WriteLine(players[(iteration + 1) % players.Length]); } } } }