from math import gcd


def pairwise_coprime(a):
    check = [set() for _ in range(10 ** 6 + 10)]
    for i, aa in enumerate(a):
        now = aa
        while now % 2 == 0:
            if i > 0 and len(check[2]) > 0 and i not in check[2]:
                return False
            now //= 2
            check[2].add(i)
        f = 3
        while f * f <= now:
            if now % f == 0:
                if i > 0 and len(check[f]) > 0 and i not in check[f]:
                    return False
                now //= f
                check[f].add(i)
            else:
                f += 2
        if now != 1:
            check[now].add(i)
    return True


def main():
    n = int(input())
    a = list(map(int, input().split()))
    ac_gcd = [a[-1] for _ in range(n)]
    for i in range(n - 2, -1, -1):
        ac_gcd[i] = gcd(a[i], ac_gcd[i + 1])
    is_pc = pairwise_coprime(a)
    if set(ac_gcd[:-1]) == {1} and is_pc:
        print("pairwise coprime")
    elif ac_gcd[0] == 1:
        print("setwise coprime")
    else:
        print("not coprime")


if __name__ == '__main__':
    main()
