local mfl, mce = math.floor, math.ceil local xor = bit.bxor local n = 100 local t = {0} for i = 2, n do local box = {} if 2 <= i and i % 2 == 0 then box[0] = true end if 3 <= i and i % 2 == 1 then local j = mfl(i / 2) local v = xor(t[j], t[j + 1]) box[v] = true end if 3 <= i then local j = mfl(i / 3) if i % 3 == 0 then box[t[j]] = true elseif i % 3 == 1 then box[t[j + 1]] = true else box[t[j]] = true end end for j = 0, 1000 do if not box[j] then t[i] = j break end end end local a = io.read("*n") print(t[a] == 0 and "B" or "A")