require 'prime' @dp={} def guchoku216(aa,turn=true) return !turn if aa.size == 0 aa.sort! return @dp[aa+[turn]] if @dp[aa+[turn]] aa.each_index{|i| ac = aa.clone ac[i]-=1 while ac[i] > 0 return @dp[aa+[turn]] = turn if (guchoku216(ac.clone,!turn) == turn) ac[i]-=1 end ac.delete(0) return @dp[aa+[turn]] = turn if (guchoku216(ac.clone,!turn) == turn) } return @dp[aa+[turn]] = !turn end def game(n) guchoku216(n.prime_division.map{|e|e[1]}) end puts game(gets.to_i) ? "Alice" : "Bob"