from math import gcd





def main():

    eval(input())  # N

    array = [int(x) for x in input().split()]

    MAX_A = 10 ** 6 + 2

    histgram = [0] * MAX_A

    for x in array:

        histgram[int(x)] += 1

    pairwise = True

    for divider in range(2, MAX_A):

        count = 0

        for counted in histgram[divider::divider]:

            count += counted

        if count > 1:

            pairwise = False

    if pairwise:

        return 'pairwise coprime'

    gcd_now = 0

    for x in array:

        gcd_now = gcd(x, gcd_now)

    if gcd_now == 1:

        return 'setwise coprime'

    else:

        return 'not coprime'





if __name__ == '__main__':

    print((main()))

from math import gcd





def main():

    eval(input())  # N

    array = [int(x) for x in input().split()]

    MAX_A = 10 ** 6 + 1

    histogram = [0] * MAX_A

    for x in array:

        histogram[int(x)] += 1

    for divider in range(2, MAX_A):

        count = 0

        for counted in histogram[divider::divider]:

            count += counted

        if count > 1:

            break

    else:

        return 'pairwise coprime'

    gcd_now = 0

    for x in array:

        gcd_now = gcd(x, gcd_now)

    if gcd_now == 1:

        return 'setwise coprime'

    else:

        return 'not coprime'





if __name__ == '__main__':

    print((main()))

from math import gcd


def main():
    eval(input())  # N
    array = [int(x) for x in input().split()]
    MAX_A = 10**6 + 2
    histgram = [0] * MAX_A
    for x in array:
        histgram[int(x)] += 1
    pairwise = True
    for divider in range(2, MAX_A):
        count = 0
        for counted in histgram[divider::divider]:
            count += counted
        if count > 1:
            pairwise = False
    if pairwise:
        return "pairwise coprime"
    gcd_now = 0
    for x in array:
        gcd_now = gcd(x, gcd_now)
    if gcd_now == 1:
        return "setwise coprime"
    else:
        return "not coprime"


if __name__ == "__main__":
    print((main()))

from math import gcd


def main():
    eval(input())  # N
    array = [int(x) for x in input().split()]
    MAX_A = 10**6 + 1
    histogram = [0] * MAX_A
    for x in array:
        histogram[int(x)] += 1
    for divider in range(2, MAX_A):
        count = 0
        for counted in histogram[divider::divider]:
            count += counted
        if count > 1:
            break
    else:
        return "pairwise coprime"
    gcd_now = 0
    for x in array:
        gcd_now = gcd(x, gcd_now)
    if gcd_now == 1:
        return "setwise coprime"
    else:
        return "not coprime"


if __name__ == "__main__":
    print((main()))

-    MAX_A = 10**6 + 2 -    histgram = [0] * MAX_A +    MAX_A = 10**6 + 1 +    histogram = [0] * MAX_A -        histgram[int(x)] += 1 -    pairwise = True +        histogram[int(x)] += 1 -        for counted in histgram[divider::divider]: +        for counted in histogram[divider::divider]: -            pairwise = False -    if pairwise: +            break +    else: