using System; using System.Collections.Generic; using System.Text; public class Program { public void Proc(){ Reader.IsDebug = false; int baseNum = int.Parse(Reader.ReadLine()); this.canWinDic = new Nullable[baseNum + 1]; Soinsu = this.GetSoinsu(baseNum); bool ans = this.GetCanWin(baseNum, this.Soinsu); Console.WriteLine(ans?"Alice":"Bob"); } public bool GetCanWin(int num, Dictionary ele) { if(this.canWinDic[num] != null) { return this.canWinDic[num].Value; } bool onlyWin = true; foreach (int key in ele.Keys) { if(ele[key] > 0) { for(int i=1; i<=ele[key]; i++) { int tmp = (int)Math.Pow(key, i); Dictionary subDic = new Dictionary(); foreach (int k in ele.Keys) { subDic.Add(k, ele[k]); } subDic[key]-=i; if(subDic[key] <=0) { subDic.Remove(key); } if(this.GetCanWin(num / tmp, subDic)) { } else { onlyWin = false; } } } } if(onlyWin) { this.canWinDic[num] = false; } else { this.canWinDic[num] = true; } return this.canWinDic[num].Value; } private Dictionary Soinsu; private Nullable[] canWinDic; private void SetBaseDic() { this.canWinDic[1] = false; foreach (int key in this.Soinsu.Keys) { for(int i=1; i<=this.Soinsu[key]; i++) { int mul = (int)Math.Pow(key, i); this.canWinDic[mul] = true; } } } private Dictionary GetSoinsu(int src) { Dictionary ret = new Dictionary(); int num = src; while (num > 1) { bool isBreak = false; for(int i=2; i<=Math.Sqrt(num); i++) { if(num % i == 0) { isBreak = true; if(ret.ContainsKey(i)) { ret[i]++; } else { ret.Add(i, 1); } num = num / i; break; } } if(isBreak == false) { break; } } if(num > 1) { if(ret.ContainsKey(num)) { ret[num]++; } else { ret.Add(num, 1); } } return ret; } public static void Main(string[] args) { Program prg = new Program(); prg.Proc(); } } class Reader { public static bool IsDebug = true; private static System.IO.StringReader sr; public static string ReadLine() { if(IsDebug) { if(sr == null) { sr = new System.IO.StringReader(initStr.Trim()); } return sr.ReadLine(); } else { return Console.ReadLine(); } } public static int[] GetInt(char delimiter = ' ') { string[] inpt = ReadLine().Split(delimiter); int[] ret = new int[inpt.Length]; for(int i=0; i