(async () => {
    let input = '';
    for await (const chunk of process.stdin) input += chunk;
    let values = input.split(/\s/).map(v => +v);

    const n = values.shift();
    values = values.slice(0, n);
    const max = values.reduce((a, b) => Math.max(a, b), 0);

    let prims = new Array(max - 2);
    for(let i = 2; i <= max; i++){
        if(!prims[i - 2]){
            prims[i - 2] = i;
            for(let j = i * 2; j <= max; j += i){
                prims[j - 2] = i;
            }
        }
    }

    const gcd = (a, b) => b ? gcd(b, a % b) : a;
    let gcd_ = values[0];
    let pairwise = true;
    for (let i = 0; i < values.length; i++) {
        if(values[i] <= 1){
            gcd_ = 1;
            continue;
        }
        if(prims[values[i] - 2] == -1 || prims[prims[values[i] - 2] - 2] == -1){
            pairwise = false;
        }
        prims[prims[values[i] - 2] - 2] = -1;
        gcd_ = gcd(gcd_, values[i]);
    }
    if(pairwise){
        console.log('pairwise coprime');
    }else if(gcd_ === 1){
        console.log('setwise coprime');
    }else{
        console.log('not coprime');
    }
})();
