from math import gcd

import numpy as np

from numba import njit



n = int(eval(input()))

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

MAX = 10 ** 6



g = a[0]

for e in a:

    g = gcd(g, e)



if g != 1:

    print("not coprime")

    exit()



nums = np.zeros(MAX + 1, np.int64)

for e in a:

    nums[e] += 1





@njit

def f(nums):

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

        if nums[i::i].sum() > 1:

            return False



    return True





bl = f(nums)



if bl:

    print("pairwise coprime")

else:

    print("setwise coprime")



import numpy as np

from numba import njit



n = int(eval(input()))

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

MAX = 10 ** 6



nums = np.zeros(MAX + 1, np.int64)

for e in a:

    nums[e] += 1





@njit

def solve(nums):

    mx = 0

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

        cnt = nums[i::i].sum()

        mx = max(mx, cnt)



    return mx





mx = solve(nums)



if nums[1] == n:

    ans = "pairwise coprime"

elif mx == n:

    ans = "not coprime"

elif mx == 1:

    ans = "pairwise coprime"

else:

    ans = "setwise coprime"



print(ans)

from math import gcd
import numpy as np
from numba import njit

n = int(eval(input()))
a = list(map(int, input().split()))
MAX = 10**6
g = a[0]
for e in a:
    g = gcd(g, e)
if g != 1:
    print("not coprime")
    exit()
nums = np.zeros(MAX + 1, np.int64)
for e in a:
    nums[e] += 1


@njit
def f(nums):
    for i in range(2, MAX + 1):
        if nums[i::i].sum() > 1:
            return False
    return True


bl = f(nums)
if bl:
    print("pairwise coprime")
else:
    print("setwise coprime")

import numpy as np
from numba import njit

n = int(eval(input()))
a = list(map(int, input().split()))
MAX = 10**6
nums = np.zeros(MAX + 1, np.int64)
for e in a:
    nums[e] += 1


@njit
def solve(nums):
    mx = 0
    for i in range(2, MAX + 1):
        cnt = nums[i::i].sum()
        mx = max(mx, cnt)
    return mx


mx = solve(nums)
if nums[1] == n:
    ans = "pairwise coprime"
elif mx == n:
    ans = "not coprime"
elif mx == 1:
    ans = "pairwise coprime"
else:
    ans = "setwise coprime"
print(ans)

-from math import gcd -g = a[0] -for e in a: -    g = gcd(g, e) -if g != 1: -    print("not coprime") -    exit() -def f(nums): +def solve(nums): +    mx = 0 -        if nums[i::i].sum() > 1: -            return False -    return True +        cnt = nums[i::i].sum() +        mx = max(mx, cnt) +    return mx -bl = f(nums) -if bl: -    print("pairwise coprime") +mx = solve(nums) +if nums[1] == n: +    ans = "pairwise coprime" +elif mx == n: +    ans = "not coprime" +elif mx == 1: +    ans = "pairwise coprime" -    print("setwise coprime") +    ans = "setwise coprime" +print(ans)