fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(' ').map { it.toInt() }

    fun gcd(a: Int, b: Int): Int {
        return if (a==1 || b== 1) 1
        else if (b == 0) a
        else if (a < b) gcd(a, b % a)
        else gcd(b, a % b)
    }

    var allgcd = a[0]
    var pc = true
    for (i in 0 until n-1) {
        allgcd = gcd(allgcd, a[i])
        for (j in i+1 until n) {
            if (!pc) break
            val g = gcd(a[i], a[j])
            if (g != 1) pc = false
        }
    }
    allgcd = gcd(allgcd, a[n-1])

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