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

def main():
    n = int(input())
    A = list(map(int,input().split()))
    LCM = 1
    GCD = A[0]
    flag = True
    for a in A[::-1]:
        if gcd(LCM,a) > 1:
            flag = False
            break
        LCM = lcm(LCM,a)
    for a in A:
        GCD = gcd(GCD,a)
    if flag:
        print("pairwise coprime")
    elif GCD == 1:
        print("setwise coprime")
    else:
        print("not coprime")
    return

if __name__ == "__main__":
    main()