from math import gcd

def primes(n,als):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        cnt = 0
        for j in range(i, n + 1, i):
            is_prime[j] = False
            if als[j]: cnt += 1
        if cnt >= 2:
            return False
    else:
        return True


def main():
    n = int(input())
    al = list(map(int, input().split()))
    als = [False]*(10**6+1)
    for a in al:
        if als[a]:
            break
        als[a] = True
    else:
        ans = primes(10**6,als)
        if ans: 
            print('pairwise coprime')
            exit()

    c_gcd = al[0]
    for a in al[1:]:
        c_gcd = gcd(c_gcd,a)
    
    if c_gcd == 1:
        print('setwise coprime')
    else:
        print('not coprime')


    # no_flag = False
    # for a in al:
    #     for p in ps:
    #         if a%p == 0:
    #             if p in pset:
    #                 no_flag = True
    #                 break
    #             else:
    #                 pset.add(p)
    #     if no_flag:
    #         break
    # else:
    #     print('pairwise coprime')
    #     exit()

    # pset = set()
    # for p in ps:
    #     if al[0]%p == 0:
    #         pset.add(p)

    # for a in al[1:]:
    #     apset = set()
    #     for p in ps:
    #         if a%p == 0:
    #             apset.add(p)
    #     pset = pset&apset
    #     if len(pset) == 0:
    #         print('setwise coprime')
    #         break
    # else:
    #     print('not coprime')



if __name__ == "__main__":
    main()