use std::collections::*;
use std::io::*;
use std::*;
// template {{{
macro_rules! get {
    ($($t:tt),*; $n:expr) => {
        {
            let stdin = std::io::stdin();
            let ret = std::io::BufRead::lines(stdin.lock()).take($n).map(|line| {
                let line = line.unwrap();
                let mut it = line.split_whitespace();
                _get!(it; $($t),*)
            }).collect::<Vec<_>>();
            ret
        }
    };
    ($($t:tt),*) => {
        {
            let mut line = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut it = line.split_whitespace();
            _get!(it; $($t),*)
        }
    };
}
macro_rules! _get {
    ($it:ident; [char]) => {
        _get!($it; String).chars().collect::<Vec<_>>()
    };
    ($it:ident; [u8]) => {
        _get!($it; String).bytes().collect::<Vec<_>>()
    };
    ($it:ident; usize1) => {
        $it.next().unwrap().parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1
    };
    ($it:ident; [usize1]) => {
        $it.map(|s| s.parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1).collect::<Vec<_>>()
    };
    ($it:ident; [$t:ty]) => {
        $it.map(|s| s.parse::<$t>().unwrap_or_else(|e| panic!("{}", e))).collect::<Vec<_>>()
    };
    ($it:ident; $t:ty) => {
        $it.next().unwrap().parse::<$t>().unwrap_or_else(|e| panic!("{}", e))
    };
    ($it:ident; $($t:tt),+) => {
        ($(_get!($it; $t)),*)
    };
}
// }}}

fn primes(n: usize) -> Vec<i64> {
    let mut isprime = vec![true; n + 1];
    for i in 2..=n {
        let mut idx = 2 * i;
        while idx < n + 1 {
            isprime[idx as usize] = false;
            idx += i;
        }
    }
    let mut ret = Vec::new();
    for i in 2..=n {
        if isprime[i] {
            ret.push(i as i64);
        }
    }
    ret
}

fn main() {
    let n = get!(usize);
    let a = get!([i64]);
    let p = primes(1010);
    let mut count = vec![0; 1020];
    let mut bigpmap: HashMap<i64, u32> = HashMap::new();
    let mut ispair = true;
    let mut isset = true;
    for i in a {
        let mut ai = i;
        for j in p.iter() {
            if ai % j == 0 {
                if count[*j as usize] > 0 {
                    ispair = false;
                }
                count[*j as usize] += 1;
                while ai % j == 0 {
                    ai /= j;
                }
            }
        }
        if ai != 1 {
            *bigpmap.entry(ai).or_insert(0) += 1;
        }
    }
    for i in count {
        if i >= n {
            isset = false;
        }
    }
    for i in bigpmap {
        if i.1 as usize >= n {
            isset = false;
        }
    }
    println!(
        "{}",
        if ispair {
            "pairwise coprime"
        } else if isset {
            "setwise coprime"
        } else {
            "not coprime"
        }
    );
}
