fun main() = abc177e()

@OptIn(ExperimentalStdlibApi::class)
fun abc177e() = IO_abc177e().exec {
    val n = readInt()
    val aList = List(n) { readInt() }

    tailrec fun gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b)

    val sieve = Sieve(2 * 1000_000)
    val appearedPrimes = mutableSetOf<Int>()

    val isPairwise = aList.all { a ->
        val factors = sieve.primeFactorization(a)
        factors.all { (k, _) -> appearedPrimes.add(k) }
    }

    if (isPairwise) return@exec println("pairwise coprime")

    val answer = if (aList.reduce { acc, i -> gcd(acc, i) } == 1) "setwise coprime" else "not coprime"

    println(answer)
}

/**
 * O(n * log(log(n))) to construct
 */
@Suppress("unused")
private class Sieve(n: Int) {
    private val divisibleBy: IntArray = IntArray(n + 1).apply { this[0] = -1;this[1] = -1 }
    private val primes: MutableSet<Int> = mutableSetOf()

    init {
        for (i in 2..n) {
            if (divisibleBy[i] != 0) continue
            primes.add(i)
            divisibleBy[i] = i
            for (j in i.toLong() * i..n step i.toLong()) {
                if (divisibleBy[j.toInt()] == 0) divisibleBy[j.toInt()] = i
            }
        }
    }

    /**
     * O(1)
     */
    fun isPrime(n: Int) = n > 1 && divisibleBy[n] == n

    /**
     * O(log(n))
     */
    fun primeFactorization(n: Int): Map<Int, Int> {
        var curr = n
        val factors = mutableMapOf<Int, Int>()
        while (curr > 1) {
            factors.merge(divisibleBy[curr], 1, Int::plus)
            curr /= divisibleBy[curr]
        }
        return factors
    }

    /**
     * O(?)
     */
    fun primeFactorization(n: Long): Map<Int, Int> {
        var curr = n
        val factors = mutableMapOf<Int, Int>()
        for (prime in primes) {
            var divCount = 0
            while (curr % prime == 0L) {
                curr %= prime; divCount++
            }
            if (divCount > 0) factors[prime] = divCount
            if (curr <= Int.MAX_VALUE && curr.toInt() in primes) break
        }
        return factors
    }
}

// region kokokara template dayo (^o^)
@Suppress("unused", "ClassName", "SpellCheckingInspection", "ConvertToStringTemplate", "MemberVisibilityCanBePrivate")
private class IO_abc177e(private val separator: String = System.lineSeparator()) {
    private val input = System.`in`
    private val buffer = ByteArray(1024)
    private var pointer = 0
    private var bufferLength = 0
    private val sb = StringBuilder()
    private fun Byte.isPrintable() = this in 33..126
    private fun Byte.isNumeric() = this in '0'.toByte()..'9'.toByte()
    private fun Byte.toNumVal() = if (this.isNumeric()) this - '0'.toByte() else error("$this is not numeric")

    private fun hasNextByte(): Boolean {
        return if (pointer < bufferLength) true else {
            pointer = 0
            bufferLength = input.read(buffer)
            bufferLength > 0
        }
    }

    private fun readByte(): Byte = if (hasNextByte()) buffer[pointer++] else -1
    private fun skipUnprintable() = run { while (hasNextByte() && !buffer[pointer].isPrintable()) pointer++ }
    private fun hasNext(): Boolean = run { skipUnprintable() }.run { hasNextByte() }
    private fun hasNextOrError() = if (!hasNext()) error("has no next element.") else Unit

    fun readString(): String {
        hasNextOrError()
        val sb = StringBuilder()
        var b = readByte()
        while (b.isPrintable()) {
            sb.appendCodePoint(b.toInt())
            b = readByte()
        }
        return sb.toString()
    }

    fun readLong(): Long {
        hasNextOrError()
        var n = 0L
        var negative = false
        var b = readByte()
        if (b == '-'.toByte()) {
            negative = true
            b = readByte()
        }
        if (!b.isNumeric()) error("$b is not numeric.")
        while (true) {
            when {
                b.isNumeric() -> n = n * 10 + b.toNumVal()
                b.toInt() == -1 || !b.isPrintable() -> return if (negative) -n else n
                else -> error("failed to parse. [n=$n, b=$b]")
            }
            b = readByte()
        }
    }

    fun readInt() = readLong()
        .let { if (it in Int.MIN_VALUE..Int.MAX_VALUE) it.toInt() else error("$it is not in range of Int.") }

    fun readDouble(): Double {
        var n = 0.0
        var div = 1.0
        var negative = false
        var b = readByte()
        if (b == '-'.toByte()) {
            negative = true
            b = readByte()
        }
        do n = n * 10 + b.toNumVal()
        while (run { b = readByte() }.run { b.isNumeric() })
        if (b == '.'.toByte()) {
            while (run { b = readByte() }.run { b.isNumeric() })
                n += b.toNumVal() / (run { div *= 10 }.run { div })
        }
        return if (negative) -n else n
    }

    fun println(): Unit = run { sb.append(separator) }
    fun print(any: Any): Unit = run { sb.append(any) }
    fun println(any: Any): Unit = run { sb.append(any.toString() + separator) }
    fun flush() = run { kotlin.io.println(sb); sb.clear() }

    fun exec(action: IO_abc177e.() -> Unit) {
        var t: Throwable? = null
        Thread(null, { action() }, "solve", 128 * 1024 * 1024)
            .apply { setUncaughtExceptionHandler { _, t1 -> t = t1 } }
            .apply { start() }.join()
        t?.let { throw it }
        kotlin.io.print(sb)
    }

    fun readLine(): Nothing = error("readLine is disabled.")
}
// endregion kokomade template dayo (^o^)


Measured memory_bytes: 93488