#!/usr/bin/env python3



import collections

import sys

input=sys.stdin.readline



def gcd(a,b):

    if b==0:

        return a

    else:

        return gcd(b,a%b)



def judge(n,arr):

    MAX=10**6

    table=[i for i in range(MAX+1)]

    for i in range(2,MAX+1):

        if table[i]<i:

            continue

        for j in range(i,MAX+1,i):

            table[j]=i

    cnt=collections.defaultdict(int)

    for val in arr:

        s=set()

        while val!=1:

            prime=table[val]

            s.add(prime)

            val//=prime

        for tmp in s:

            cnt[tmp]+=1

    for val in list(cnt.values()):

        if val>=2:

            return False

    return True

    

n=int(eval(input()))

arr=list(map(int,input().split()))

tmp=arr[0]

for val in arr:

    tmp=gcd(tmp,val)

if tmp==1:

    is_setwise=True

else:

    is_setwise=False

is_pairwise=judge(n,arr)

if is_pairwise==True:

    print('pairwise coprime')

elif is_setwise==True:

    print('setwise coprime')

else:

    print('not coprime')
import collections

import sys

input=sys.stdin.readline



def divisors(n):

  ret=[]

  for i in range(2,int(n**0.5)+1):

    if n%i==0:

      ret.append(i)

      while n%i==0:

        n//=i

  if n!=1:

    ret.append(n)

  return ret



def gcd(a,b):

  if b==0:

    return a

  else:

    return gcd(b,a%b)



n=int(eval(input()))

arr=list(map(int,input().split()))

cnt=[False]*(max(arr)+1)

is_pairwise=True

tmp=arr[0]

for val in arr:

  tmp=gcd(tmp,val)

  if is_pairwise==False:

    continue

  divisor=divisors(val)

  for val2 in divisor:

    if cnt[val2]==True:

      is_pairwise=False

      break

    cnt[val2]=True

if tmp==1:

  is_setwise=True

else:

  is_setwise=False

if is_pairwise==True:

  print('pairwise coprime')

elif is_setwise==True:

  print('setwise coprime')

else:

  print('not coprime')
#!/usr/bin/env python3
import collections
import sys

input = sys.stdin.readline


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


def judge(n, arr):
    MAX = 10**6
    table = [i for i in range(MAX + 1)]
    for i in range(2, MAX + 1):
        if table[i] < i:
            continue
        for j in range(i, MAX + 1, i):
            table[j] = i
    cnt = collections.defaultdict(int)
    for val in arr:
        s = set()
        while val != 1:
            prime = table[val]
            s.add(prime)
            val //= prime
        for tmp in s:
            cnt[tmp] += 1
    for val in list(cnt.values()):
        if val >= 2:
            return False
    return True


n = int(eval(input()))
arr = list(map(int, input().split()))
tmp = arr[0]
for val in arr:
    tmp = gcd(tmp, val)
if tmp == 1:
    is_setwise = True
else:
    is_setwise = False
is_pairwise = judge(n, arr)
if is_pairwise == True:
    print("pairwise coprime")
elif is_setwise == True:
    print("setwise coprime")
else:
    print("not coprime")

import collections
import sys

input = sys.stdin.readline


def divisors(n):
    ret = []
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            ret.append(i)
            while n % i == 0:
                n //= i
    if n != 1:
        ret.append(n)
    return ret


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


n = int(eval(input()))
arr = list(map(int, input().split()))
cnt = [False] * (max(arr) + 1)
is_pairwise = True
tmp = arr[0]
for val in arr:
    tmp = gcd(tmp, val)
    if is_pairwise == False:
        continue
    divisor = divisors(val)
    for val2 in divisor:
        if cnt[val2] == True:
            is_pairwise = False
            break
        cnt[val2] = True
if tmp == 1:
    is_setwise = True
else:
    is_setwise = False
if is_pairwise == True:
    print("pairwise coprime")
elif is_setwise == True:
    print("setwise coprime")
else:
    print("not coprime")

-#!/usr/bin/env python3 + + +def divisors(n): +    ret = [] +    for i in range(2, int(n**0.5) + 1): +        if n % i == 0: +            ret.append(i) +            while n % i == 0: +                n //= i +    if n != 1: +        ret.append(n) +    return ret -def judge(n, arr): -    MAX = 10**6 -    table = [i for i in range(MAX + 1)] -    for i in range(2, MAX + 1): -        if table[i] < i: -            continue -        for j in range(i, MAX + 1, i): -            table[j] = i -    cnt = collections.defaultdict(int) -    for val in arr: -        s = set() -        while val != 1: -            prime = table[val] -            s.add(prime) -            val //= prime -        for tmp in s: -            cnt[tmp] += 1 -    for val in list(cnt.values()): -        if val >= 2: -            return False -    return True - - +cnt = [False] * (max(arr) + 1) +is_pairwise = True +    if is_pairwise == False: +        continue +    divisor = divisors(val) +    for val2 in divisor: +        if cnt[val2] == True: +            is_pairwise = False +            break +        cnt[val2] = True -is_pairwise = judge(n, arr)