#!/usr/bin/env python3

import functools

try:
    from math import gcd
except ImportError:
    from fractions import gcd


def gcds(xs):
    return functools.reduce(gcd, xs)


def lcm(a, b):
    return a // gcd(a, b) * b


def lcms(xs):
    return functools.reduce(lcm, xs)


def prods(xs):
    return functools.reduce(lambda a, b: a * b, xs)


def is_pairwise_coprime(xs):
    return lcms(xs) == prods(xs)


def is_setwise_coprime(xs):
    return gcds(xs) == 1


def main():
    n = int(input())
    bs = [int(b) for b in input().split()]
    if is_pairwise_coprime(bs):
        print("pairwise coprime")
    elif is_setwise_coprime(bs):
        print("setwise coprime")
    else:
        print("not coprime")


if __name__ == '__main__':
    main()