include Math gets.to_i.times{ d,x,t = gets.split.map(&:to_i) if t == 0 puts "ZETUBOU" end if d == 1 puts "AC" elsif (d - 2) * log2(x + 1) > log2(t) puts "ZETUBOU" elsif (d - 1) * log2(x + 2) <= log2(t + 1) puts "AC" else sum = 0 ans = "AC" (x+1).downto(1){|n| sum += n ** (d - 2) if sum > t ans = "ZETUBOU" break end } puts ans end }