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

    val allP = mutableSetOf<Int>()
    val dupP = Array<Int>(1000000) {0}
    val chkP = mutableSetOf<Int>()
    var pMax = 0
    var pc = true

    fun sb(inp :Int): Set<Int> {
        var n = inp
        val s = Math.floor(Math.sqrt(n.toDouble())).toInt()
        val ret = mutableSetOf<Int>()
        if (!pc) {
            chkP.forEach {
                if (n % it == 0) {
                    ret.add(it)
                }
            }
        } else {
            if (n % 2 == 0) {
                ret.add(2)
            }
            var i = 3
            while (i <= s) {
                if (n % i == 0) {
                    ret.add(i)
                }
                i += 2
            }
        }
        return ret
    }

    readLine()!!.split(' ').map { s->
        val p = sb(s.toInt())
        if (p.isEmpty()) {
            println ("setwise coprime")
            return
        }
        p.forEach {
            dupP[it]++
            if (it in allP) {
                pc = false
                pMax = Math.max(pMax, dupP[it])
                chkP.add(it)
            }
            allP.add(it)
        }
    }

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