use proconio::*;


fn check(b: &[usize], n: usize) -> i32 {
    let mut is_prime = vec![true; 1000001];
    is_prime[0] = false;
    is_prime[1] = false;

    let mut ret = 0;
    for i in 0..1001 {
        if !is_prime[i] {
            continue;
        }

        let mut j = i*2;
        let mut cnt = b[i];
        while j < 1000001 {
            is_prime[j] = false;
            cnt += b[j];
            j += i;
        }

        if cnt == n {
            return 2;
        }
        if cnt > 1 {
            ret = 1;
        }
    }
    
    ret
}

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

    let mut b = vec![0; 1000001];
    for &i in a.iter() {
        b[i] += 1;
    }

    println!("{}", match check(&b, n) {
        0 => "pairwise coprime",
        1 => "setwise coprime",
        _ => "not coprime",
    });
}
