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

    val fCnt = mutableMapOf<Long, Long>()
    var isPC = true

    outer@for (a in aa) {
        val factors = factors(a)
        for (k in factors.keys) {
            if (fCnt[k] != null) {
                isPC = false
                break@outer
            }
            fCnt[k] = 1L
        }
    }

    if (isPC) {
        println("pairwise coprime")
        return
    }

    val sc = aa.reduce { acc, i -> gcd(acc, i) }
    if (sc == 1L) {
        println("setwise coprime")
    } else {
        println("not coprime")
    }
}

fun gcd(a : Long, b : Long) : Long {
    return if (a % b == 0L) b else gcd(b, a % b)
}

fun factors(value: Long): Map<Long, Long> {
    val factors = mutableMapOf<Long, Long>()
    val max = Math.sqrt(value.toDouble()).toLong()
    var tmp = value

    for (i in 2..max) {
        while (tmp % i == 0L) {
            tmp /= i
            factors[i] = (factors[i] ?: 0) + 1
        }
    }

    if (tmp != 1L) {
        factors[tmp] = 1
    }

    return factors
}