import math
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    A = list(map(int,input().rstrip().split(" ")))
    M = int(math.sqrt(max(A))) + 1
    sosuu = set()
    sosuu.add(2)
    for i in range(3,M,2):
        for j in sosuu:
            if i % j == 0:
                break
        else:
            sosuu.add(i)
    pair = True
    setw = True
    counter = 0
    lis = [0] * (10 ** 6 + 1)
    for q in range(len(A)):
        i = A[q]
        for j in sosuu:
            if i % j == 0:
                while i % j == 0:
                    i = i // j
                lis[j] += 1
            
        if i != 1:
            lis[i] += 1
            if lis[i] == 2:
                pair = False
                
    for i in lis:
        if i == N:
            setw = False
        if i >= 2:
            pair = False
        if not setw and not pair:
            break

    if pair:
        print("pairwise coprime")
    elif setw:
        print("setwise coprime")
    else:
        print("not coprime")

if __name__ == '__main__':
    main()