output_description: If \\{A_i\\} is pairwise coprime, print `pairwise coprime`; if \\{A_i\\} is
  setwise coprime, print `setwise coprime`; if neither, print `not coprime`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 \ldots A_N
attempt: import sys
  
  sys.setrecursionlimit(10**6)
  int1 = lambda x: int(x) - 1
  p2D = lambda x: print(*x, sep="\n")
  
  
  def II():
      return int(sys.stdin.readline())
  
  
  def MI():
      return map(int, sys.stdin.readline().split())
  
  
  def LI():
      return list(map(int, sys.stdin.readline().split()))
  
  
  def LLI(rows_number):
      return [LI() for _ in range(rows_number)]
  
  
  def SI():
      return sys.stdin.readline()[:-1]
  
  
  class Sieve:
      def __init__(self, n):
          self.plist = [2]  # n以下の素数のリスト
          min_prime_factor = [2, 0] * (n // 2 + 5)
          for x in range(3, n + 1, 2):
              if min_prime_factor[x] == 0:
                  min_prime_factor[x] = x
                  self.plist.append(x)
                  if x**2 > n:
                      continue
                  for y in range(x**2, n + 5, 2 * x):
                      if min_prime_factor[y] == 0:
                          min_prime_factor[y] = x
          self.min_prime_factor = min_prime_factor
  
      def isprime(self, x):
          return self.min_prime_factor[x] == x
  
      # これが素因数分解(prime factorization)
      def pfct(self, x):
          pp, ee = [], []
          while x > 1:
              mpf = self.min_prime_factor[x]
              if pp and mpf == pp[-1]:
                  ee[-1] += 1
              else:
                  pp.append(mpf)
                  ee.append(1)
              x //= mpf
          return pp
  
  
  mx = 10**6 + 5
  n = II()
  aa = LI()
  sv = Sieve(mx)
  use = [0] * mx
  ispair = True
  for a in aa:
      pp = sv.pfct(a)
      for p in pp:
          if use[p]:
              ispair = False
          use[p] += 1
  if ispair:
      print("pairwise coprime")
  elif max(use) < n:
      print("setwise coprime")
  else:
      print("not coprime")
  
problem_description: Statement
  
  We have N integers. The i-th number is A_i.
  
  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every
  pair (i, j) such that 1\leq i < j \leq N.
  
  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime
  but GCD(A_1,\ldots,A_N)=1.
  
  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.
  
  Here, GCD(\ldots) denotes greatest common divisor.
samples: [{"input": "3\n    3 4 5", "output": "pairwise coprime\n    \n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\n* * *"}, {"input": "3\n    6 10 15", "output": "setwise coprime\n    \n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since\nGCD(6,10,15)=1, they are setwise coprime.\n\n* * *"}, {"input": "3\n    6 10 16", "output": "not coprime\n    \n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime."}]