n = int(input())
a = list(map(int,input().split()))
MAX = 10**6+1

is_prime = [1]*MAX
primes = []
pf = {key:[] for key in a}

is_prime[0],is_prime[1] = 0,0

for i in range(2,MAX):
  if is_prime[i]:
    primes.append(i)
    k = i*2
    while k < MAX:
      is_prime[k] = 0
      if pf.get(k,-1) != -1:
        pf[k].append(i)
      k += i
      
primes_counter = {prime:0 for prime in primes}

for i in range(n):
  for p in pf[a[i]]:
    primes_counter[p] += 1

pc_flag = True
sc_flag = True

for p in primes:
  if primes_counter[p]>1:
    pc_flag = False
    if primes_counter[p] == n:
      sc_flag = False

if pc_flag:
  print('pairwise coprime')
elif sc_flag:
  print('setwise coprime')
else:
  print('not coprime')