const factorization = (n) => {
    let primes = []
    for(let i=2; i*i<=n; i++) {
        let e=0
        while(n%i===0) {
            e++
            n/=i
        }
        if(e) {
            primes.push(i)
        }
    }
    if(n>1) {
        primes.push(n)
    }
    return primes
}

const getGCD = (a,b) => {
    if(b===0)return a
    else if(a===0)return b
    return getGCD(b, a%b)
}

const main = (arg) => {
    const N = Number(arg.split("\n")[0])
    const a = arg.split("\n")[1].split(" ").map(Number)
    
    const MAX_A = 10**6+1
    
    //  check if p is in {a} (paircoprime)
    const primes = SieveOfEratosthenes(MAX_A)
    let set = [...new Array(MAX_A)].fill(0)
    isPairCoprime = true
    for(let i=0; i<N; i++) {
        //const factors = Object.keys(factorizationBySoE(a[i], primes))
  	    const factors = factorization(a[i])
  	    console.log(`${a[i]}`)
  	    console.log(factors)
        for(let j=0; j<factors.length; j++ ) {
            if(set[factors[j]] === 1) {
                isPairCoprime = false
            }
            set[factors[j]] = 1
        }
    }

  	if(isPairCoprime) {
        console.log("pairwise coprime")
        return
    }

  // setcoprime
    let gcd = 0
    for(let i=0; i<a.length; i++) {
        gcd = getGCD(gcd, a[i])
    }
    
    if(gcd===1) {
        console.log("setwise coprime")
        return
    }
    
    console.log("not coprime")
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));

