//use itertools::Itertools;
use std::cmp;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::collections::BinaryHeap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::io::Read;
use std::usize::MAX;

macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

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

    let dead = eratosthenes(1000000);

    //println!("{:?}", eratosthenes(10000));

    let mut count = vec![0; 1000001];
    let mut pairwise = true;

    for i in 0..a.len() {
        count[dead[a[i]]] += 1;

        if count[dead[a[i]]] > 1 {
            pairwise = false;
            break;
        }
    }

    //println!("{:?}", count);

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

    let gcd_num = a.iter().fold(0, |acc, now| gcd(acc, *now));
    if gcd_num == 1 {
        println!("setwise coprime");
        return;
    }

    println!("not coprime");
}

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet
// 最大公約数
fn gcd(a: usize, b: usize) -> usize {
    let mut aa: usize = if a > b { a } else { b };
    let mut bb: usize = if a > b { b } else { a };
    while bb != 0 {
        let tmp = bb;
        bb = aa % tmp;
        aa = tmp;
    }
    return aa;
}

// エラストテネスの篩
fn eratosthenes(n: usize) -> Vec<usize> {
    let mut search_list: VecDeque<usize> = VecDeque::new();

    let mut dead = vec![0; n + 1];
    let n_sqrt = (n as f64).sqrt() as usize + 1;

    for i in 2..n + 1 {
        search_list.push_back(i);
    }

    loop {
        let new_prime = match search_list.pop_front() {
            Some(x) => x,
            None => panic!(),
        };

        dead[new_prime] = new_prime;

        // search_listからの除外
        search_list = search_list
            .iter()
            .filter(|x| {
                if **x % new_prime != 0 {
                    true
                } else {
                    if dead[**x] == 0 {
                        dead[**x] = new_prime
                    }
                    false
                }
            })
            .map(|x| *x)
            .collect();

        if search_list.front() == None {
            break;
        }

        if search_list.front().unwrap() > &n_sqrt {
            break;
        }
    }

    while search_list.len() > 0 {
        let prime = search_list.pop_front().unwrap();
        dead[prime] = prime;
    }

    return dead;
}
