gets.to_i.times{ d,x,t = gets.split.map(&:to_i) if d == 1 count = 1 else count = [*1..(x+1)].inject{|sum,n| sum + n ** (d - 1)} end if count > t puts "ZETUBOU" else puts "AC" end }