def fast_prime_factorization_many(lst):
    # 素因数分解（ロー法、複数）
    from subprocess import Popen, PIPE
    res = Popen(["factor"] + list(map(str, lst)), stdout=PIPE).communicate()[0].split(b"\n")[:-1]
    return [set(list(map(int, r.split()[1:]))) for r in res]

def main():
    import sys
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))

    Factors = fast_prime_factorization_many(A)
    fset = set(Factors[0])
    fcommon = set(Factors[0])
    eleflg = True
    for f in Factors[1:]:
      fcommon = fcommon & f
      if len(fset & f) == 0:
        fset = fset | f
      else:
        eleflg = False
        # 互いに素でないペアがいる
        pass
    if len(fcommon) > 0:
      print("not coprime")
    elif eleflg:
      print("pairwise coprime")
    else:
      print("setwise coprime")
    #print(fcommon)
    exit(0)

main()
