import java.lang.Integer.max
import java.lang.Integer.min

//

fun main() {
    abc177e()
}

fun abc177e() {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toInt() }
    val gcds = mutableMapOf<Int, Int>()
    for (i in 0 until n) {
        var j = 2
        var t = a[i]
        while (j * j <= t) {
            if (t % j == 0) {
                gcds[j] = gcds.getOrDefault(j, 0) + 1
                if (t / j != j) {
                    gcds[t / j] = gcds.getOrDefault(t / j, 0) + 1
                }
            }
            j++
        }
        gcds[t] = gcds.getOrDefault(t, 0) + 1
    }
    val maxCount = gcds.maxBy { it.value }!!
    if (maxCount.value == 1) {
            println("pairwise coprime")
    } else if (maxCount.value == n) {
        println("not coprime")
    } else {
        println("setwise coprime")
    }
}
