def factorize(n)
  i = 2_i64
  h = Hash(Int64, Int64).new(0_i64)
  until i * i > n
    if n % i == 0
      n = n // i
      h[i] += 1
    else
      i += 1
    end
  end
  if n > 1
    h[n] += 1
  end
  h.keys.to_set
end


gets
ais = read_line.split.map(&.to_i64)
lcm = Set(Int64).new
is_pairwise_coprime = true
ais.each do |a|
  factors = factorize(a)
  if lcm.intersects?(factors)
    is_pairwise_coprime = false
  end
  lcm |= factorize(a)
end
if is_pairwise_coprime
  puts "pairwise coprime"
elsif ais.reduce {|a, b| a.gcd(b)} == 1
  puts "setwise coprime"
else
  puts "not coprime"
end