local mfl, mce = math.floor, math.ceil
local msq = math.sqrt
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 primes = getprimes(mce(msq(1000000)))

local function getdivisorparts(x)
  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 n = io.read("*n")
local a = {}
for i = 1, n do
  a[i] = io.read("*n")
end
local t = {}
local test1 = false
for i = 1, n do
  local dvp = getdivisorparts(a[i])
  for j = 1, #dvp do
    local k = dvp[j].p
    if t[k] then
      test1 = true break
    else
      t[k] = true
    end
  end
  if test1 then break end
end
if not test1 then
  print("pairwise coprime")
  os.exit()
end
local gcd = a[1]

local function getgcd(x, y)
  while 0 < x do
    x, y = y % x, x
  end
  return y
end

for i = 2, n do
  gcd = getgcd(gcd, a[i])
  if gcd == 1 then
    print("setwise coprime") os.exit()
  end
end
print("not coprime")
