# SPDX-License-Identifier: X11
# 2020-08-29 (Live)
# Coprime (500pt)

function main()
  N = parse(Int, readline())
  A = parse.(Int, split(readline(), " "))

  if reduce(gcd, A) > 1
    println("not coprime")
    return 0
  end

  sort!(A)
  bound = (Int ∘ trunc ∘ sqrt)(A[N])

  ps = erato(bound)
  as = falses(bound)

  for i ∈ A
    if hash!(i, as, ps) === nothing
      println("setwise coprime")
      return 0
    end
  end

  println("pairwise coprime")
end

function erato(bound)
  A = falses(bound)
  A[2] = true

  for i ∈ 3:2:bound
    A[i] = true
  end

  for i ∈ 3:2:bound
    if A[i]
      for j ∈ i:2:(bound ÷ i)
        A[i * j] = false
      end
    end
  end

  return A
end

function hash!(n, as, ps)
  if n & 1 == 0
    if as[2]
      return nothing
    else
      as[2] = true
    end
  end

  for i ∈ 3:2:(Int ∘ trunc ∘ sqrt)(n)
    if ps[i] && n % i == 0
      if as[i]
        return nothing
      else
        as[i] == true
      end
    end
  end

  return n
end

main()
