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

    val allP = mutableSetOf<Int>()

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

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

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