#!/usr/bin/python3
# -*- coding:utf-8 -*-

def sieve_of_eratosthenes(n):
  primes = [2]
  cands = list(range(3, n+1, 2))
  while len(cands) != 0:
    prime = primes[-1]
    cands = list(filter(lambda x:x%prime != 0, cands))
    if len(cands) == 0:
      break
    primes.append(cands.pop(0))
  return primes

def factorize(n, primes):
  factors = []
  for prime in primes:
    while n%prime == 0:
      factors.append(prime)
      n//=prime
      if n < 2:
        break
  if n > 1:
    factors.append(n)
  return factors

def main():
  n = int(input())
  lc = [0] * (10**6)
  primes = sieve_of_eratosthenes(int((10**6)**0.5))
  for a in list(map(int, input().strip().split())):
    for p in set(factorize(a, primes)):
      lc[p] += 1
  if max(lc) < 2:
    print('pairwise coprime')
  elif max(lc) < n:
    print('setwise coprime')
  else:
    print('not coprime')

if __name__=='__main__':
  main()

