use proconio::input;
use num_integer::{gcd};

#[proconio::fastout]
pub fn main() {
    input! {
        n:usize,
        a:[usize;n],
    }
    let mut primes = Vec::with_capacity(78498);
    primes.push(2);
    'outer: for i in 3..=n {
        for &p in &primes {
            if i % p == 0 {
                continue 'outer;
            }
        }
        primes.push(i);
    }

    //let a: Vec<isize>;
    let a = a.into_iter().filter(|&x| x != 1).collect::<Vec<usize>>();
    let somewise_coprime = a.len() == 0 || (a.iter().fold(a[0], |x, &y| gcd(x, y)) == 1);
    if !somewise_coprime {
        println!("not coprime");
    } else {
        let pairwise_coprime = a.len() == 0 || a.len() > 78498 ||
            {
                let mut res = true;
                'outer: for &p in &primes {
                    let mut cnt = 0;
                    for &x in &a {
                        if x % p == 0 {
                            cnt += 1;
                            if cnt >= 2 {
                                res = false;
                                break 'outer;
                            }
                        }
                    }
                }
                res
            };
        if pairwise_coprime {
            println!("pairwise coprime");
        } else {
            println!("setwise coprime");
        }
    }
}
