import java.io.BufferedReader
import java.io.BufferedWriter
import kotlin.math.sqrt

fun main() = Case().exec(::solve)

fun solve(c: Case) {
    c.long()
    val factorsList = c.longList().map { Prime.primeFactors(it).toSet() }
    val factorCount = factorsList.map { it.size }.sum()
    val uniqueFactorCount = factorsList.reduce { acc, set -> acc + set }.size
    val coprimeCount = factorsList.reduce { acc, set -> acc.intersect(set) }.size

    if (factorCount == uniqueFactorCount) {
        c.println("pairwise coprime")
    } else if (coprimeCount == 0) {
        c.println("setwise coprime")
    } else {
        c.println("not coprime")
    }
}

object Prime {
    fun primeFactors(n: Long): List<Long> {
        if (n <= 1L) return listOf()
        val max = sqrt(n.toDouble()).toLong()
        val factors = mutableListOf<Long>()
        var target = n
        while (target % 2 == 0L) { // 定数倍高速化
            factors.add(2); target /= 2
        }
        for (i in 3..max step 2) {
            while (target % i == 0L) {
                factors.add(i); target /= i
            }
        }
        if (target != 1L) {
            factors.add(target)
        }
        return factors
    }
}

class Case(
    private val input: BufferedReader = System.`in`.bufferedReader(),
    private val out: BufferedWriter = System.out.bufferedWriter()
) {
    fun exec(fn: (Case) -> Unit) = input.use { out.use { execInThread(fn) } }
    private fun execInThread(fn: (Case) -> Unit) =
        Thread(null, { fn(this) }, "solve", 64 * 1024 * 1024)
            .apply { setUncaughtExceptionHandler { _, e -> e.printStackTrace(); kotlin.system.exitProcess(1) } }
            .apply { start() }.join()

    fun println(c: CharSequence?) = out.appendln(c)
    fun string(): String = input.readLine().trimEnd()
    fun long(): Long = input.readLine().toLong()
    fun intList(): List<Int> = input.readLine().split(" ").map { it.toInt() }
    fun longList(): List<Long> = input.readLine().split(" ").map { it.toLong() }
}