use proconio::input;

fn main() {
    input! {
        n: usize,
        v: [usize; n]
    }

    let tbl = primes(1_000_000);

    let flag = {
        let mut flag = false;
        for &p in &tbl {
            if flag {
                break;
            }
            let mut ff = false;
            for &x in &v {
                let xx = x%p == 0;
                if !ff && xx {
                    ff = true;
                } else if ff && xx {
                    flag = true;
                    break;
                }
            }
        }
        flag
    };


    if !flag {
        println!("pairwise coprime")
    } else {
        let mut jj = v[0];
        for i in 1..n {
            jj = num::integer::gcd(jj,v[i]);
        }
        if jj == 1 {
            println!("setwise coprime")
        } else {
            println!("not coprime")
        }
    }
}

pub fn primes(n: usize) -> Vec<usize> {
    let mut tbl = vec![true; n];
    let mut ps = vec![];
    tbl[0] = false;
    tbl[1] = false;
    for i in 2..n {
        if tbl[i] {
            ps.push(i);
            let mut j = i + i;
            while j < n {
                tbl[j] = false;
                j += i;
            }
        }
    }
    ps
}