import sys

input = lambda: sys.stdin.readline().rstrip("\r\n")



def max_gcd_pair(S):

    # Assumption 1: S is the list of numbers

    # Assumption 2: There are no duplicates in S



    s = set(S)

    m = max(S)



    res = 0

    i = m



    while(i > 0):

        a = i

        cnt = 0

        while (a<=m): # a maxed at max of the list

            if a in s:   

               cnt += 1

            a += i



        if cnt >= 2:  # we have found the result

            res = i

            break



        i = i -1 



    return res



n = int(eval(input()))

a = [int(x) for x in input().split()]



from collections import Counter



c = Counter(a)

flag = 1

for i in a:

    if c[i] > 1 and i != 1:

        flag = 0

if flag:

    if max_gcd_pair(a) <= 1:

        print('pairwise coprime')

        sys.exit()



import math

from functools import reduce



def gcd(*numbers):

    return abs(reduce(math.gcd, numbers))



if gcd(*a) == 1:

    print('setwise coprime')

    sys.exit()



else:

    print('not coprime')

import sys

input = lambda: sys.stdin.readline().rstrip("\r\n")



n = int(eval(input()))

a = [int(x) for x in input().split()]



# 1~aの最大値までの数の最小の素因数を前処理で求める(O(max_aloglog(max_a)))

def smallest_prime_factors(a):

    max_a = max(a)

    smallest_prime_factors = [int(x) for x in range(max_a + 1)]

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

        if smallest_prime_factors[i] == i:

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

                if smallest_prime_factors[j] == j:

                    smallest_prime_factors[j] = i

        else:

            continue

    return smallest_prime_factors



smallest_prime_factors = smallest_prime_factors(a)



# nを素因数分解(O(log(n)))

def prime_factorize(n):

    prime_factors = []

    if n == 1:

        return prime_factors

    while n != smallest_prime_factors[n]:

        prime_factors.append(smallest_prime_factors[n])

        n //= smallest_prime_factors[n]

    prime_factors.append(n)

    return prime_factors



prime_factors = set()



flag = 1



for i in a:

    prime_factorize_i = set(prime_factorize(i))

    for j in prime_factorize_i:

        if j in prime_factors:

            flag = 0

            break

        else:

            prime_factors.add(j)



if flag:

    print('pairwise coprime')

    sys.exit()



import math

from functools import reduce



def gcd(*numbers):

    return abs(reduce(math.gcd, numbers))



if gcd(*a) == 1:

    print('setwise coprime')

else:

    print('not coprime')
import sys

input = lambda: sys.stdin.readline().rstrip("\r\n")


def max_gcd_pair(S):
    # Assumption 1: S is the list of numbers
    # Assumption 2: There are no duplicates in S
    s = set(S)
    m = max(S)
    res = 0
    i = m
    while i > 0:
        a = i
        cnt = 0
        while a <= m:  # a maxed at max of the list
            if a in s:
                cnt += 1
            a += i
        if cnt >= 2:  # we have found the result
            res = i
            break
        i = i - 1
    return res


n = int(eval(input()))
a = [int(x) for x in input().split()]
from collections import Counter

c = Counter(a)
flag = 1
for i in a:
    if c[i] > 1 and i != 1:
        flag = 0
if flag:
    if max_gcd_pair(a) <= 1:
        print("pairwise coprime")
        sys.exit()
import math
from functools import reduce


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


if gcd(*a) == 1:
    print("setwise coprime")
    sys.exit()
else:
    print("not coprime")

import sys

input = lambda: sys.stdin.readline().rstrip("\r\n")
n = int(eval(input()))
a = [int(x) for x in input().split()]
# 1~aの最大値までの数の最小の素因数を前処理で求める(O(max_aloglog(max_a)))
def smallest_prime_factors(a):
    max_a = max(a)
    smallest_prime_factors = [int(x) for x in range(max_a + 1)]
    for i in range(2, max_a + 1):
        if smallest_prime_factors[i] == i:
            for j in range(i, max_a + 1, i):
                if smallest_prime_factors[j] == j:
                    smallest_prime_factors[j] = i
        else:
            continue
    return smallest_prime_factors


smallest_prime_factors = smallest_prime_factors(a)
# nを素因数分解(O(log(n)))
def prime_factorize(n):
    prime_factors = []
    if n == 1:
        return prime_factors
    while n != smallest_prime_factors[n]:
        prime_factors.append(smallest_prime_factors[n])
        n //= smallest_prime_factors[n]
    prime_factors.append(n)
    return prime_factors


prime_factors = set()
flag = 1
for i in a:
    prime_factorize_i = set(prime_factorize(i))
    for j in prime_factorize_i:
        if j in prime_factors:
            flag = 0
            break
        else:
            prime_factors.add(j)
if flag:
    print("pairwise coprime")
    sys.exit()
import math
from functools import reduce


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


if gcd(*a) == 1:
    print("setwise coprime")
else:
    print("not coprime")

+n = int(eval(input())) +a = [int(x) for x in input().split()] +# 1~aの最大値までの数の最小の素因数を前処理で求める(O(max_aloglog(max_a))) +def smallest_prime_factors(a): +    max_a = max(a) +    smallest_prime_factors = [int(x) for x in range(max_a + 1)] +    for i in range(2, max_a + 1): +        if smallest_prime_factors[i] == i: +            for j in range(i, max_a + 1, i): +                if smallest_prime_factors[j] == j: +                    smallest_prime_factors[j] = i +        else: +            continue +    return smallest_prime_factors -def max_gcd_pair(S): -    # Assumption 1: S is the list of numbers -    # Assumption 2: There are no duplicates in S -    s = set(S) -    m = max(S) -    res = 0 -    i = m -    while i > 0: -        a = i -        cnt = 0 -        while a <= m:  # a maxed at max of the list -            if a in s: -                cnt += 1 -            a += i -        if cnt >= 2:  # we have found the result -            res = i -            break -        i = i - 1 -    return res +smallest_prime_factors = smallest_prime_factors(a) +# nを素因数分解(O(log(n))) +def prime_factorize(n): +    prime_factors = [] +    if n == 1: +        return prime_factors +    while n != smallest_prime_factors[n]: +        prime_factors.append(smallest_prime_factors[n]) +        n //= smallest_prime_factors[n] +    prime_factors.append(n) +    return prime_factors -n = int(eval(input())) -a = [int(x) for x in input().split()] -from collections import Counter - -c = Counter(a) +prime_factors = set() -    if c[i] > 1 and i != 1: -        flag = 0 +    prime_factorize_i = set(prime_factorize(i)) +    for j in prime_factorize_i: +        if j in prime_factors: +            flag = 0 +            break +        else: +            prime_factors.add(j) -    if max_gcd_pair(a) <= 1: -        print("pairwise coprime") -        sys.exit() +    print("pairwise coprime") +    sys.exit() -    sys.exit()