fun main(args: Array<String>) {
    val N = readLine()!!.toInt()

    fun sb(inp :Int): Set<Int> {
        var n = inp
        val s = Math.floor(Math.sqrt(n.toDouble())).toInt()
        var r = 0
        val ret = mutableSetOf<Int>()
        for (i in 2..s) {
            if (n%i == 0) {
                r = 0
                while(n%i == 0) {
                    r++
                    n /= i
                }
                ret.add(i)
            }
        }
        if (n > s) ret.add(n)
        return ret
    }

    val allP = mutableSetOf<Int>()
    val dupP = Array<Int>(1000000) {0}
    var pc = true
    val a = readLine()!!.split(' ').map {s->
        val p = sb(s.toInt())
        p.forEach {
            if (it in allP) {
                pc = false
            }
            dupP[it]++
            allP.add(it)
        }
    }

    println(
        when {
            pc -> "pairwise coprime"
            dupP.max() == N -> "not coprime"
            else -> "setwise coprime"
        }
    )
}
