fun main() {
    val n = readInt()
    val a = readInts()

    fun gcd(a: Int, b: Int): Int {
        if (b == 0) return a
        return gcd(b, a % b)
    }

    val g = a.reduce { acc, i -> gcd(acc, i) }
    val maxN = 1000000
    val isPrime = BooleanArray(maxN + 1) { true }
    val nums = a.toMutableSet()
    if (1 in nums) nums.remove(1)

    if (g != 1) println("not coprime")
    else {
        var pairwise = true
        for (i in 2..maxN) {
            var howMany = 0
            if (isPrime[i]) {
                for (j in i..maxN step i) {
                    isPrime[j] = false
                    if (j in nums) howMany++
                }
            }
            if (howMany > 1) {
                pairwise = false
                break
            }
        }
        println(if (pairwise) "pairwise coprime" else "setwise coprime")
    }
}

// Input Reader
private fun readLn() = readLine()!!

private fun readStrings() = readLn().trim().split(" ")
private fun readInt() = readLn().toInt()
private fun readInts() = readStrings().map { it.toInt() }
