# frozen_string_literal: true

require 'prime'

n = gets.to_i
a = gets.split.map(&:to_i)

@p = {}

@primes = Prime.each(a.max).to_a

def prime_division(n)
  return @p[n] if @p[n]

  divs = []
  @primes.each do |p|
    break if n == 1

    if n % p == 0
      divs.push p
      n /= p while (n % p).zero?
    end
  end
  @p[n] = divs
end

b = Array.new(n + 1, false)
flag = true
a.each do |e|
  prime_division(e).each do |p|
    if b[p]
      flag = false
      break
    end
    b[p] = true
  end
  break unless flag
end

if flag
  puts 'pairwise coprime'
  exit
end

g = a[0]
(1..(n - 1)).each do |i|
  g = g.gcd(a[i])
end

if g == 1
  puts 'setwise coprime'
else
  puts 'not coprime'
end
