n = int(input())
A = tuple(map(int, input().split()))
U = 10**6
D = list(range(U+1))
i = 2
while i*i <= U:
  if D[i] != i:
    i += 1
    continue
  for j in range(i*i, U+1, i):
    D[j] = min(D[j], i)
  i += 1
C = [0]*(U+1)
is_pairwise = True
for a in A:
  while a > 1:
    d = D[a]
    while a%d == 0:
      a //= d
    if C[d]:
      is_pairwise = False
    C[d] += 1
if max(C) == n:
  print("not coprime")
else:
  if is_pairwise:
    print("pairwise coprime")
  else:
    print("setwise coprime")