def ascan; gets.split.map(&:to_i); end def scan; gets.to_i; end require 'prime' gets; while cin = gets aa = cin.split.map(&:to_i); pp = aa.map{|e| Prime.prime_division(e)} nn = pp.map{|c| c.map{|k,v| v}} gg = nn.map{|v| v.reduce(0){|s,e| s^(e%3)}} g = gg.reduce(0){|s,e| s^e} #p g puts g==0 ? "Bob" : "Alice" end