'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7 #998244353
dir = [(-1,0),(0,-1),(1,0),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"

def main():
    n = int(ipt())
    min_pri = [i for i in range(10**6+1)]
    ps = []
    for i in range(2,10**3):
        if min_pri[i] != i:
            continue
        else:
            ps.append(i)
            for j in range(i,10**6+1,i):
                if min_pri[j] == j:
                    min_pri[j] = i

    a = [int(i) for i in ipt().split()]
    g = a[0]
    d = defaultdict(bool)
    f1 = True
    for i in a:
        g = math.gcd(g,i)
        if f1 and i != 1:
            ni = i
            pi = bisect.bisect_left(ps,min_pri[i])
            for j in ps[pi::]:
                ff = True
                while ni%j == 0:
                    if ff:
                        if d[j]:
                            f1 = False
                            break
                        d[j] = True
                        ff = False
                    ni //= j
                if not f1 or ni == 1:
                    break
            if ni != 1:
                d[ni] = True

    if f1:
        print("pairwise coprime")
    elif g == 1:
        print("setwise coprime")
    else:
        print("not coprime")




    return None

if __name__ == '__main__':
    main()
