(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 gcd = (a, b) => b ? gcd(b, a % b) : a;
    let gcd_ = values[0];
    for (let i = 0; i < values.length; i++) {
        for (let j = i + 1; j < values.length; j++) {
            if(gcd(values[i], values[j]) === 1){
                console.log('pairwise coprime');
                return;
            }
        }
        gcd_ = gcd(gcd_, values[i]);
    }
    if(gcd_ === 1){
        console.log('setwise coprime');
    }else{
        console.log('not coprime');
    }
})();
