fun str() = readLine()!!
fun int() = str().toInt()
fun long() = str().toLong()

fun read(d:String = " ") = str().split(d)
fun <T> list(d:String = " ",f:String.()->T) = read(d).map {f(it)}
fun list() = list {toInt()}

fun <T> MutableList<T>.removeLast() = this.removeAt(this.lastIndex)

const val mod = 1000000007L

fun main() {
	abc000X()
}

fun abc000X() {
	val n = int()
	val a = list()

	val p = IntArray(1000000) {0}

	var pairwise = true

	for(v in a) {
		var w = v

		for(i in 2..v) {
			if(i.toLong()*i>=v) {
				if(++p[w]>=2)
					pairwise = false
				break
			}
			if(w%i==0) {
				if(++p[i]>=2)
					pairwise = false
				while(w%i==0)
					w /= i
			}
		}
	}

	if(pairwise)
		println("pairwise coprime")
	else if(!p.contains(n))
		println("setwise coprime")
	else
		println("not coprime")
}
