import sys
import io, os
input = sys.stdin.buffer.readline
#input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline

import math
N = 10**6+50

def main():

    n = int(input())
    A = list(map(int, input().split()))

    spf = [-1]*(N+1)
    for i in range(N+1):
        spf[i] = i
    for i in range(2, int(math.sqrt(N))+1):
        if spf[i] == i:
            for j in range(i*2, N+1, i):
                if spf[j] == j:
                    spf[j] = i

    S = set()
    flag = False
    for i, a in enumerate(A):
        s = set()
        while a != 1:
            p = spf[a]
            if p in S:
                #print('setwise coprime')
                #exit()
                flag = True
            s.add(p)
            a //= p
        S = S | s
        if i == 0:
            T = s
        else:
            T = T & s

    #print(S)
    #print(T)
    if len(T) != 0:
        print('not coprime')
    elif flag:
        print('setwise coprime')
    else:
        print('pairwise coprime')

if __name__ == '__main__':
    main()
