local bxor = bit.bxor local mce, mfl, msq, mmi, mma, mab = math.ceil, math.floor, math.sqrt, math.min, math.max, math.abs local function getprimes(x) local primes = {} local allnums = {} for i = 1, x do allnums[i] = true end for i = 2, x do if allnums[i] then table.insert(primes, i) local lim = mfl(x / i) for j = 2, lim do allnums[j * i] = false end end end return primes end local function getdivisorparts(x, primes) local prime_num = #primes local tmp = {} local lim = mce(msq(x)) local primepos = 1 local dv = primes[primepos] while primepos <= prime_num and dv <= lim do if x % dv == 0 then local t = {} t.p = dv t.cnt = 1 x = mfl(x / dv) while x % dv == 0 do x = mfl(x / dv) t.cnt = t.cnt + 1 end table.insert(tmp, t) lim = mce(msq(x)) end if primepos == prime_num then break end primepos = primepos + 1 dv = primes[primepos] end if x ~= 1 then local t = {} t.p, t.cnt = x, 1 table.insert(tmp, t) end return tmp end local tt = {0} local function getdivisorCore(divisorparts) local m = {} local pat = 1 local len = #divisorparts local allpat = 1 for i = 1, len do allpat = allpat * (1 + divisorparts[i].cnt) end for t_i_pat = 0, allpat - 2 do local div = allpat local i_pat = t_i_pat local ret = 1 for i = 1, len do div = mfl(div / (divisorparts[i].cnt + 1)) local mul = mfl(i_pat / div) i_pat = i_pat % div for j = 1, mul do ret = ret * divisorparts[i].p end end m[tt[ret]] = true end for i = 0, 1000000 do if not m[i] then return i end end assert(false) return false end local function getdivisor(x, primes) local dvp = getdivisorparts(x, primes) return getdivisorCore(dvp) end local primes = getprimes(1000) for i = 2, 1000 * 1000 do tt[i] = getdivisor(i, primes) end -- print(os.clock()) -- os.exit() local n = io.read("*n", "*l") local ret = 0 local s = io.read() for w in s:gmatch("%d+") do local a = tonumber(w) ret = bxor(ret, tt[a]) end print(ret == 0 and "black" or "white")