import java.io.BufferedReader
import java.io.BufferedWriter
import kotlin.math.sqrt

fun main() = Case().exec(::solve)
//fun main() = TestExecutor.assert(testCase) { Case(it.r, it.w).exec(::solve) }

fun solve(c: Case) {
    val primer = PreCalculatedPrime(1000000)
    c.long()
    val a = c.longList().map { it.toInt() }

    val factorsList = a.map { primer.primeFactors(it).toSet() }
    val factorCount = factorsList.map { it.size }.sum()
    val uniqueFactorCount = factorsList.reduce { acc, set -> acc + set }.size
    val globalGcd = a.reduce { acc, item -> gcd(acc, item) }

    when {
        factorCount == uniqueFactorCount -> c.println("pairwise coprime")
        globalGcd == 1 -> c.println("setwise coprime")
        else -> c.println("not coprime")
    }
}

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

class PreCalculatedPrime(maxInt: Int) {
    private val eratosthenesSieve: List<Int>

    init {
        val sieve = MutableList(maxInt + 1) { 0 }
        val rooted = sqrt(maxInt.toDouble()).toInt()
        (2..rooted).forEach outer@{ a ->
            if (sieve[a] != 0) return@outer
            (2..maxInt).forEach { time ->
                if (a * time > maxInt) return@outer
                if (sieve[a * time] == 0) {
                    sieve[a * time] = a
                }
            }
        }
        eratosthenesSieve = sieve
    }

    fun primeFactors(n: Int): List<Int> {
        if (n <= 1) return listOf()
        val primes = mutableListOf<Int>()
        var x = n
        while (true) {
            val prime = eratosthenesSieve[x]
            if (prime == 0) {
                primes.add(x)
                return primes
            }
            primes.add(prime)
            x /= prime
        }
    }
}
