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 sorted = a.sorted()
    val gcds = MutableList<Int>(n) { 0 }
    var p = 0
    for (i in 0 until n) {
        if (p == sorted[i]) {
            gcds[i] = gcds[i - 1]
            continue
        }
        var j = 2
        gcds[i] = sorted[i]
        while (j * j <= sorted[i]) {
            if (sorted[i] % j == 0) {
                gcds[i] = j
                break
            }
            j++
        }
    }
    val counts = gcds.groupingBy { it }.eachCount()
    val count = counts.maxBy { it.value }!!
    if (count.value == 1) {
        println("pairwise coprime")
    } else if (count.value == n) {
        println("not coprime")
    } else {
        println("setwise coprime")
    }
}
