def main():
    from itertools import chain
    import sys
    input = sys.stdin.readline

    def gcd(x, y):
        if y == 0:
            return x
        return gcd(y, x % y)
    # 6n+1, 6n-1でも求めて、素数**2+素数*kはふるいおとす
    def prime_set(N):
        """
        Nまでの素数のsetを返す
        """
        if N < 4:
            return ({}, {}, {2}, {2, 3})[N]
        Nsq = int(N ** 0.5 + 0.5) + 1
        primes = {2, 3} | set(chain(range(5, N + 1, 6), range(7, N + 1, 6)))
        for i in range(5, Nsq, 2):
            if i in primes:
                primes -= set(range(i * i, N + 1, i * 2))
        return list(primes)

    def factorization(n, prime_set):
        l = []
        tmp = n
        nsq = int(n ** 0.5 + 0.5) + 1
        for i in prime_set:
            if  i > nsq: 
                break 
            if tmp%i == 0:
                while tmp%i == 0:
                    tmp //= i
                l.append(i)
        if tmp != 1:
            l.append(tmp)
        if l == []:
            if n != 1:
                l.append(n)
        return l
    n = int(input())
    A = [int(x) for x in input().split()]
    len_A = len(A)
    # setwise coprimeの条件(1ならOK)
    g = 0
    for a in A:
        g = gcd(g, a)
    # 素数列挙
    num = 10**6+1
    primes = prime_set(num)
    # 全部素因数分解
    prime_list = [0] * (num+1)
    pairwise_f = True
    ll = list()
    for a in A:
        l = []
        tmp = a
        # nsq = int(a ** 0.5 + 0.5) + 1
        for i in primes:
            if  i*i > a:
                break 
            if tmp%i == 0:
                while tmp%i == 0:
                    tmp //= i
                prime_list[i] += 1
                l.append(i)
        if tmp != 1:
            prime_list[tmp] += 1
            l.append(tmp)
        if l == []:
            if a != 1:
                prime_list[n] += 1
                l.append(a)
        set_prime_list = set(prime_list)
        if len_A > 10**5:
            if set_prime_list != set([0]) and set_prime_list != set([0, 1]):
                pairwise_f = False
                break
    # print(prime_list[:100])
    if set_prime_list != set([0]) and set_prime_list != set([0, 1]):
        pairwise_f = False
    if pairwise_f:
        print('pairwise coprime')
    elif g == 1:
        print('setwise coprime')
    else:
        print('not coprime')

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
 
    def find(target):
        if parent[target] < 0:
            return target
        else:
            parent[target] = find(parent[target])
            return parent[target]
 
    def is_same(x, y):
        return find(x) == find(y)
 
    def union(x, y):
        root_x = find(x)
        root_y = find(y)
        if root_x == root_y:
            return
        if parent[root_x] > parent[root_y]:
            root_x, root_y = root_y, root_x
        parent[root_x] += parent[root_y]
        parent[root_y] = root_x

    def members(n, x):
        root = find(x)
        return [i for i in range(n) if find(i) == root]
 
    def get_size(x):
        return -parent[find(x)]
 
    def get_root():
        return [i for i, root in enumerate(parent) if root < 0]

    n, m = map(int, input().split())
    parent = [-1 for _ in range(n)]
    for _ in range(m):
        a, b = map(lambda x: int(x) - 1, input().split())
        union(a, b)
        # print(parent)
    ans = 0
    for i in range(n):
        ans = max(ans, get_size(i))
    print(ans)
    # 状況理解用
    # max_member = 0
    # for i in get_root():
    #     # print(i, members(n, i))
    #     max_member  = max(max_member, len(members(n, i)))
    # print(max_member)

if __name__ == '__main__':
    main()