object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val as = List.fill(n)(sc.nextLong())
  val m = 1000000

  def divisors(n: Int): Array[Int] = {
    val divisors = Array.fill(n+1)(0)
    for (i <- 2 to n if divisors(i) == 0) {
      var k = 1
      while (i * k <= n) {
        if (divisors(i * k) == 0) {
          divisors(i * k) = i
        }
        k += 1
      }
    }
    divisors
  }

  val divisor = divisors(m)

  def primeFactors(n: Int, res: IndexedSeq[Int] = IndexedSeq()): IndexedSeq[Int] = {
    if (n == 1) {
      res
    } else {
      val d = divisor(n)
      if (d == n) {
        res :+ n
      } else {
        var m = n
        var res2 = res
        while (m % d == 0) {
          m /= d
          res2 :+= d
        }
        primeFactors(m, res2)
      }
    }
  }

  def gcd(a: Long, b: Long): Long = {
    if (b == 0) a else gcd(b, a % b)
  }

  val exist = Array.fill(m+1)(false)
  var pair = true
  as.map(a => primeFactors(a.toInt)).foreach(fs =>
    for (f <- fs.distinct) {
      if (exist(f)) {
        pair = false
      } else {
        exist(f) = true
      }
    }
  )

  if (pair) {
    println("pairwise coprime")
  } else if (as.reduceLeft[Long]{case (x, y) => gcd(x, y)} == 1) {
    println("setwise coprime")
  } else {
    println("not coprime")
  }
}
