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

    let maxn: usize = 1000000;
    let mut dp: Vec<usize> = vec![0; maxn + 1];

    for i in (2..).take_while(|&x| x * x <= maxn) {
        if dp[i] != 0 { continue; }
        for j in (i..maxn).step_by(i) {
            if dp[j] == 0 { dp[j] = i; }
        }
    }
 
    let mut used: Vec<bool>  = vec![false; maxn + 1];

    let mut is_paircoprime = true;

    for i in 0..n {
        let mut x = a[i];
        while x != 1 {
            let y = dp[x];
            if x != 1 && used[x] { is_paircoprime = false; }
            if y != 1 && used[y] { is_paircoprime = false; }
            used[x] = true;
            used[y] = true;
            while x % y == 0 { x /= y; }
        }

        if !is_paircoprime { break; }
    }

    if is_paircoprime {
        println!("pairwise coprime");
        return;
    }

    let setwise = &a.iter()
        .fold(a[0], |x: usize, &y: &usize| num::integer::gcd(x, y) as usize);

    if *setwise == 1 {
        println!("setwise coprime");
        return;
    }

    println!("not coprime");
    return;
}
