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).map{|x,c|[x]*c}.flatten!} nn = pp.map(&:size) #p nn g = nn.reduce(0){|s,e| s^(e>3 ? 3: e)} puts g<2 ? "Bob" : "Alice" end