import std.algorithm, std.conv, std.range, std.stdio, std.string; import std.bigint; // BigInt void main() { auto q = readln.chomp.to!size_t; auto di = new int[](q), xi = new int[](q), ti = new long[](q); foreach (i; 0..q) { auto rd = readln.split; di[i] = rd[0].to!int; xi[i] = rd[1].to!int; ti[i] = rd[2].to!long; } auto maxXD = zip(di, xi).map!"a[0] + a[1]".maxElement; auto facts = new BigInt[](maxXD); facts[0] = 1; foreach (i; 1..maxXD) facts[i] = facts[i-1] * i; foreach (d, x, t; lockstep(di, xi, ti)) { auto c = facts[x+d-1] / facts[x] / facts[d-1]; writeln(c <= t ? "AC" : "ZETUBOU"); } }