CodeEff/ECCO huggingface dataset:
# Original solution
mod = 10**9 + 7
def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)
def solve():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    primes = []
    isprime = [True for i in range(1001)]
    for i in range(2, 1001):
        if isprime[i]:
            primes.append(i)
            for j in range(i * i, 1001, i):
                isprime[j] = False
    x = a[0]
    f = True

    cnt = [0 for i in range(1000001)]
    for val in a:
        x = gcd(x, val)
        i = 0
        tmp_val = val
        while i < len(primes) and primes[i] ** 2 <= tmp_val:
            if val % primes[i] == 0:
                cnt[primes[i]] += 1
                while val % primes[i] == 0:
                    val //= primes[i]
            i += 1
        if val > 1:
            cnt[val] += 1
    for i in range(2, 1000001):
        if cnt[i] > 1:
            f = False
            break
    if f:
        print('pairwise coprime')
    elif x == 1:
        print('setwise coprime')
    else:
        print('not coprime')



t = 1
while t > 0:
    solve()
    t -= 1

# Optimized solution
mod = 10**9 + 7
def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)
def solve():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    primes = []
    isprime = [True for i in range(1001)]
    for i in range(2, 1001):
        if isprime[i]:
            primes.append(i)
            for j in range(i * i, 1001, i):
                isprime[j] = False
    x = a[0]
    f = True

    cnt = [0 for i in range(1000001)]
    for val in a:
        x = gcd(x, val)
        i = 0
        while i < len(primes) and primes[i] ** 2 <= val:
            if val % primes[i] == 0:
                cnt[primes[i]] += 1
                while val % primes[i] == 0:
                    val //= primes[i]
            i += 1
        if val > 1:
            cnt[val] += 1
    for i in range(2, 1000001):
        if cnt[i] > 1:
            f = False
            break
    if f:
        print('pairwise coprime')
    elif x == 1:
        print('setwise coprime')
    else:
        print('not coprime')



t = 1
while t > 0:
    solve()
    t -= 1
# Original solution
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = float('inf')
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))

    N = NI()
    A = LI()

    # 1000までの素数列
    t = [True] * 1000
    for i in range(2,33):
        j = 2
        while i * j < 1000:
            t[i*j] = False
            j += 1
    p = []
    for i in range(2,1000):
        if t[i]: p.append(i)

    cnt = [0] * 1000000
    for x in A:
        for d in p:
            if x % d == 0:
                while x % d == 0:
                    x //= d
                if cnt[d]: break
                cnt[d] += 1
        else:
            if x > 1:
                if cnt[x]: break
                cnt[x] += 1
            continue
        break
    else:
        print('pairwise coprime')
        return

    g = A[0]
    for x in A[1:]:
        g = math.gcd(g,x)
        if g == 1:
            print('setwise coprime')
            return
    print('not coprime')

if __name__ == '__main__':
    main()

# Optimized solution
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = float('inf')
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))

    N = NI()
    A = LI()

    # 1000までの素数列
    t = [True] * 1000
    for i in range(2,33):
        j = 2
        while i * j < 1000:
            t[i*j] = False
            j += 1
    p = []
    for i in range(2,1000):
        if t[i]: p.append(i)

    cnt = [0] * 1000000
    for x in A:
        nf = True
        for d in p:
            if d > x: break
            if x % d == 0:
                while x % d == 0:
                    x //= d
                if cnt[d]:
                    nf = False
                    break
                cnt[d] += 1
        else:
            if x > 1:
                if cnt[x]:
                    nf = False
                    break
                cnt[x] += 1
            continue
        if nf: continue
        break
    else:
        print('pairwise coprime')
        return

    g = A[0]
    for x in A[1:]:
        g = math.gcd(g,x)
        if g == 1:
            print('setwise coprime')
            return
    print('not coprime')

if __name__ == '__main__':
    main()
# Original solution
#abc177 e
import sys,math,collections,itertools
input = sys.stdin.readline

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    if arr==[]:
        arr.append(n)
    return arr


N=int(eval(input()))
A=list(map(int,input().split()))
num = [0]*(10**6+1)

fact = [0]*(10**6+1)
fact[1]=1

for a in A:
    if a != 1:
        flag = 0
        temp = a
        for i in range(2, int(-(-a**0.5//1))+1):
            if temp%i==0:
                while temp%i==0:
                    temp //= i
                flag = 1
                fact[i]+=1
        if temp!=1:
            fact[temp]+=1
            flag = 1
        if flag==0:
            fact[n]+=1


        
mn= max(fact)

if mn == 1:
    print('pairwise coprime')
elif mn ==N:
    print('not coprime')
else:
    print('setwise coprime')


# Optimized solution
#abc177 e
import sys,math,collections,itertools
import functools
input = sys.stdin.readline


N=int(eval(input()))
A=list(map(int,input().split()))
fact = set()
for a in A:
    if a==1:
        fact.add(1)
        continue
    if a%2 == 0 and 2 in fact:
        break
    while a%2==0:
        fact.add(2)
        a//=2
            
    i =3
    while i*i <= a:
        if a%i ==0 and i in fact:
            break
        while a%i==0:
            fact.add(i)
            a//=i
        else:
            i +=2
    else:
        if a != 1:
            if a in fact:
                break
            fact.add(a)
        continue
    break
else:
    print('pairwise coprime')
    exit()
if functools.reduce(math.gcd,A)!=1:
    print('not coprime')
else:
    print('setwise coprime')
# Original solution
import sys
import math
from collections import defaultdict


def first_prime_list(N):
    D = [1] * (N + 1)

    for i in range(2, N + 1):
        if D[i] != 1:
            continue
        for j in range(1, N // i + 1):
            if D[i * j] == 1:
                D[i * j] = i

    return D


def factorization_with_fpl(A, D):

    Ps = defaultdict(int)
    current_p = D[A]

    while D[A] > 1:
        cnt = 0
        while D[A] == current_p:
            A = A // D[A]
            cnt += 1

        Ps[current_p] = cnt
        current_p = D[A]

    if A != 1:
        Ps[A] = 1

    return Ps


N = int(sys.stdin.readline().rstrip())
A = [int(x) for x in sys.stdin.readline().rstrip().split()]

D = first_prime_list(max(A))

pc = True
sp = True

maxlist = factorization_with_fpl(A[0], D)

GCD = A[0]
for i in range(1,N):
    GCD = math.gcd(GCD, A[i])

for i in range(1, N):
    d = factorization_with_fpl(A[i], D)
    for p in list(d.keys()):
        if min(maxlist[p], d[p]) != 0:
            pc = False
        maxlist[p] = max(maxlist[p], d[p])

if GCD != 1:
    print("not coprime")
elif pc:
    print("pairwise coprime")
else:
    print("setwise coprime")


# Optimized solution
import sys
import math


N_MAX = 200000 + 5
INF = 10**9 + 7
sys.setrecursionlimit(N_MAX)
MOD = 10**9 + 7


def main():
    N = int(sys.stdin.readline().rstrip())
    A = [int(x) for x in sys.stdin.readline().rstrip().split()]

    maxA = max(A)

    # 1 <= a <= maxA までの、要素の登場回数
    C = [0] * (maxA + 1)
    for a in A:
        C[a] += 1

    pc = True

    # p の倍数である個数をカウントする
    for p in range(2, maxA + 1):
        cnt = 0
        for k in range(maxA // p + 1):
            cnt += C[k * p]

        # k*p となるような要素が2個以上あったら、pairwise coprime ではない
        if cnt > 1:
            pc = False

    if pc:
        print("pairwise coprime")
        return

    GCD = A[0]
    for i in range(1, N):
        GCD = math.gcd(GCD, A[i])

    if GCD == 1:
        print("setwise coprime")
        return

    print("not coprime")


main()
# Original solution
import itertools
import math


def resolve():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    B = itertools.combinations(A, 2)
    C = list([math.gcd(x[0], x[1]) for x in B])

    if len(list(set(C))) == 1 and list(set(C))[0] == 1:
        print("pairwise coprime")
    elif len(list(set(C))) != 1:
        print("setwise coprime")
    elif len(list(set(C))) == 1:
        print("not coprime")

resolve()

# Optimized solution
import math


def resolve():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    M = max(A) + 1
    C = [0 for i in range(M)]
    for a in A:
        C[a] += 1

    pairwise = True
    for i in range(2, M):
        cnt = 0
        for j in range(i, M, i):
            cnt += C[j]

        if cnt > 1:
            pairwise = False

    if pairwise:
        print("pairwise coprime")
        return

    g = 0
    for i in range(n):
        g = math.gcd(g, A[i])

    if g == 1:
        print("setwise coprime")
        return

    print("not coprime")

resolve()
# Original solution
n = int(eval(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")

# Optimized solution
import sys
input = sys.stdin.readline
def main():
  n = int(eval(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")
if __name__ == "__main__":
  main()
# Original solution
from collections import defaultdict
from math import gcd

def solve():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    all = 0
    for a in A:
        all = gcd(all, a)
    if all != 1:
        return "not coprime"

    M = 10 ** 6
    B = defaultdict(int)
    for a in A:
        B[a] += 1

    for i in range(2, M + 1):
        cnt = 0
        for j in range(i, M, i):
            cnt += B[j]
        if cnt > 1:
            return "setwise coprime"

    return "pairwise coprime"

print((solve()))


# Optimized solution
from math import gcd

def solve():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    all = 0
    for a in A:
        all = gcd(all, a)
    if all != 1:
        return "not coprime"

    M = 10 ** 6
    B = dict()
    for a in A:
        if a in B:
            B[a] += 1
        else:
            B[a] = 1

    for i in range(2, M + 1):
        cnt = 0
        for j in range(i, M, i):
            if j in B:
                cnt += B[j]
        if cnt > 1:
            return "setwise coprime"

    return "pairwise coprime"

print((solve()))
# Original solution
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def factorize(n, d):
  # if n == 0 or n == 1:
    # return []
    arr = []
    tmp = n
    while True:
      i = d[tmp]
      if i == 1:
        break
      #cnt=0
      while tmp%i==0:
        #cnt+=1
        tmp //= i
      arr.append(i)
    if tmp!=1:
      arr.append(tmp)
    if arr==[]:
      arr.append(n)
    return arr

def minimum_prime(n):
  # 試し割りをする際の最小の素数
  # エラトステネスの篩と同様の実装
    d = list(range(n+1))
    d[0] = 1
    for i in range(2, int(n**0.5) + 1):
        if d[i] != i:
          continue
        for j in range(i * 2, n + 1, i):
          if d[j] == j:
            d[j] = i
    return d  

def main():
  n = int(eval(input()))
  arr = list(map(int, input().split()))
  max_arr = max(arr)
  d = minimum_prime(max_arr)
  
  if gcd(*arr) != 1:
    print('not coprime')
    exit()
  
  searched = []
  for a in arr:
    if a != 1:
      primes = factorize(a, d)
      for p in primes:
        if p in searched:
          print('setwise coprime')
          exit()
        searched.append(p)

  print('pairwise coprime')
    
  
main()

# Optimized solution
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def factorize(n, d):
  # if n == 0 or n == 1:
    # return []
    arr = []
    tmp = n
    while True:
      i = d[tmp]
      if i == 1:
        break
      #cnt=0
      while tmp%i==0:
        #cnt+=1
        tmp //= i
      arr.append(i)
    if tmp!=1:
      arr.append(tmp)
    if arr==[]:
      arr.append(n)
    return arr

def minimum_prime(n):
  # 試し割りをする際の最小の素数
  # エラトステネスの篩と同様の実装
    d = list(range(n+1))
    d[0] = 1
    for i in range(2, int(n**0.5) + 1):
        if d[i] != i:
          continue
        for j in range(i * 2, n + 1, i):
          if d[j] == j:
            d[j] = i
    return d  

def main():
  n = int(eval(input()))
  arr = list(map(int, input().split()))
  max_arr = max(arr)
  d = minimum_prime(max_arr)
  dp = [0]*(max_arr+1)
  
  if gcd(*arr) != 1:
    print('not coprime')
    exit()
  
  searched = []
  for a in arr:
    if a != 1:
      primes = factorize(a, d)
      for p in primes:
        dp[p] += 1

  if max(dp) < 2:
    print('pairwise coprime')
  else:
    print('setwise coprime')
    

main()
# Original solution
from math import gcd
N = int(eval(input()))
A = list(map(int,input().split()))

g = 0
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

MAXN = 10**6+10
sieve = [0,0] + [1]*MAXN
p = 2
primes = set()
while p*p <= MAXN:
    if sieve[p]:
        primes.add(p)
        for q in range(2*p,MAXN+1,p):
            sieve[q] = 0
    p += 1
for i in range(p,MAXN+1):
    if sieve[i]:
        primes.add(i)

for a in A:
    dels = set()
    for p in primes:
        if p > a: continue
        while a%p==0:
            a //= p
            dels.add(p)
    if a > 1:
        print('setwise coprime')
        exit()
    for p in dels:
        primes.remove(p)
print('pairwise coprime')

# Optimized solution
from math import gcd
N = int(eval(input()))
A = list(map(int,input().split()))

g = 0
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

sa = set()
for a in A:
    if a==1: continue
    if a in sa:
        print('setwise coprime')
        exit()
    sa.add(a)

MAXN = 10**6+10
sieve = [0,0] + [1]*MAXN
p = 2
small_primes = []
while p*p <= MAXN:
    if sieve[p]:
        small_primes.append(p)
        for q in range(2*p,MAXN+1,p):
            sieve[q] = 0
    p += 1

st = set()
for a in A:
    for p in small_primes:
        found = False
        while a%p==0:
            a //= p
            found = True
        if found:
            if p in st:
                print('setwise coprime')
                exit()
            st.add(p)
        if a==1: break
    else:
        if a in st:
            print('setwise coprime')
            exit()
        st.add(a)

print('pairwise coprime')
# Original solution
from math import gcd
N = int(eval(input()))
A = list(map(int,input().split()))

g = 0
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

MAXA = 10**6
B = [0] * (MAXA+1)
for a in A:
    if a==1: continue
    if B[a]:
        print('setwise coprime')
        exit()
    B[a] = 1

for n in range(2,MAXA+1):
    c = 0
    for m in range(n,MAXA+1,n):
        c += B[m]
        if c > 1:
            print('setwise coprime')
            exit()

print('pairwise coprime')

# Optimized solution
from math import gcd
N = int(eval(input()))
A = list(map(int,input().split()))

def solve():
    g = 0
    for a in A:
        g = gcd(g,a)
    if g > 1:
        print('not coprime')
        exit()

    MAXA = 10**6
    B = [0] * (MAXA+1)
    for a in A:
        if a==1: continue
        if B[a]:
            print('setwise coprime')
            exit()
        B[a] = 1

    for n in range(2,MAXA+1):
        c = 0
        for m in range(n,MAXA+1,n):
            c += B[m]
            if c > 1:
                print('setwise coprime')
                exit()

    print('pairwise coprime')
solve()
# Original solution
from math import gcd
N = int(eval(input()))
A = list(map(int,input().split()))

g = 0
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

from collections import Counter
def factorize(n):
    d = Counter()
    m = 2
    while m*m <= n:
        while n%m == 0:
            n //= m
            d[m] += 1
        m += 1
    if n > 1:
        d[n] += 1
    return d

ctr = Counter()
for a in A:
    fac = factorize(a)
    if fac & ctr:
        print('setwise coprime')
        exit()
    ctr |= fac
print('pairwise coprime')

# Optimized solution
from math import gcd
N = int(eval(input()))
A = list(map(int,input().split()))

g = 0
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

def factorize(n):
    d = set()
    m = 2
    while m*m <= n:
        while n%m == 0:
            n //= m
            d.add(m)
        m += 1
    if n > 1:
        d.add(n)
    return d

st = set()
for a in A:
    fac = factorize(a)
    if fac & st:
        print('setwise coprime')
        exit()
    st |= fac
print('pairwise coprime')
# Original solution
from math import gcd
import sys
sys.setrecursionlimit(1000000)

def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    tmp = gcd(A[0],A[1])
    set_A = set(A)
    for i in range(2,N):
        tmp = gcd(tmp, A[i])

    if tmp != 1:
        print('not coprime')
        exit()
    max_A = max(A)
    ans = [0] * (max_A + 1)
    ans = [set() for _ in range(max_A + 1)]
    flag = True
    for i in range(2,int(max_A ** 0.5) +1):
        tmp = 1
        b = 0
        c = set()
        while b <= max_A:
            b = i * tmp
            if {b} & set_A:
                c.add(b)
            if len(c) >= 2:
                flag = False
                break
            if b > max_A:
                break
            ans[b].add(i)
            tmp += 1
    if flag:
        print('pairwise coprime')
    else:
        print('setwise coprime')
    






if __name__ == "__main__":
    main()

# Optimized solution
from math import gcd
import sys
sys.setrecursionlimit(1000000)

def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    tmp = gcd(A[0],A[1])
    set_A = set(A)
    for i in range(2,N):
        tmp = gcd(tmp, A[i])

    if tmp != 1:
        print('not coprime')
        exit()
    max_A = max(A)
    ans = [False] * (max_A + 1)
    flag = True
    def divisor(n):
        ass = []
        for i in range(1,int(n**0.5)+1):
            if n%i == 0:
                ass.append(i)
                if ans[i]:
                    return False
                if i != 1:
                    ans[i] = True
                if i**2 == n:
                    continue
                if ans[n//i]:
                    return False
                ans[n//i] = True
                ass.append(n//i)
        if n != 1:
            ans[n] = True
        return True #sortされていない
    for a in A:
        if not divisor(a):
            flag = False
            break

    if flag:
        print('pairwise coprime')
    else:
        print('setwise coprime')
    






if __name__ == "__main__":
    main()
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

M = 1000

P = [True for i in range(M+1)]
p_set = set()
for i in range(2,M+1):
  if P[i]:
    p_set.add(i)
    for j in range(2*i, M+1, i):
      P[j] = False
#print( len(p_set) )
#N = 10 ** 6
#A = [1001 for i in range(N)]

c = 0
for p in p_set:
  c_tmp = 0
  for i in range(N):
    if A[i] % p == 0:
      c_tmp += 1
      while A[i] % p == 0:
        A[i] //= p
  c = max(c, c_tmp)

dic = {}
for a in A:
  if a > M:
    if a in dic:
      dic[a] += 1
    else:
      dic[a] = 1
for v in list(dic.values()):
  c = max(c, v)

if c == N:
  print("not coprime")
elif c < 2:
  print("pairwise coprime")
else:
  print("setwise coprime")

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
#A = [888881 for i in range(10**6)]
M = max(A)


#高速素因数分解
#前処理：その数にある最小の素因数→エラトステネスの篩で最初におとすもの
P = [1 for i in range(M+1)]
for i in range(2, M+1):
    if P[i] == 1:
        for j in range(i, M+1, i):
            if P[j] == 1:
                P[j] = i
dic = {}
for a in A:
  t_dic = {}
  x = a
  while x > 1:
    if P[x] in t_dic:
      t_dic[ P[x] ] += 1
    else:
      t_dic[ P[x] ] = 1    
    x //= P[x]
  for k in list(t_dic.keys()):
    if k in dic:
      dic[k] += 1
    else:
      dic[k] = 1
#print(dic)
c = 0
for v in list(dic.values()):
  c = max(c, v)

if c == len(A):
  print("not coprime")
elif c < 2:
  print("pairwise coprime")
else:
  print("setwise coprime")