n = read_line.to_i
a = read_line.split.map(&.to_i)
ps = [2]
is_prime = Array.new(1001, true)
3.step(to: is_prime.size - 1, by: 2) do |i|
  next if !is_prime[i]
  ps << i
  (i * i).step(to: is_prime.size - 1, by: i) do |j|
    is_prime[j] = false
  end
end
all = [] of Int32
any = Set(Int32).new
pairwise = true
gcd = a[0]
n.times do |i|
  gcd = gcd.gcd(a[i])
  v = a[i]
  ps.each do |p|
    if v % p == 0
      v //= p
      while v % p == 0
        v //= p
      end
      if any.includes?(p)
        pairwise = false
      else
        any.add(p)
      end
    end
  end
  if v != 1
    if any.includes?(v)
      pairwise = false
    else
      any.add(v)
    end
  end
end
if !any
  puts "pairwise coprime"
elsif gcd == 1
  puts "setwise coprime"
else
  puts "not coprime"
end
