#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {//
           n:usize,
    mut       a:[usize;n],
       }
    let mut st = BTreeSet::new();
    for &x in a.iter() {
        st.insert(x);
    }
    let mut allgcd = gcd_list(&a);
    if st.len() != n {
        if allgcd == 1 {
            println!("{}", "setwise coprime");
        } else {
            println!("{}", "not coprime");
        }
        return;
    }
    a.sort();
    let mut st = BTreeSet::new();
    let mut all = true;
    for &x in a.iter() {
        let mut pf = prime_factor(x as i64);
        for (k, v) in pf {
            let kk = k;
            if st.contains(&k) {
                all = false;
                break;
            } else {
                st.insert(kk);
            }
        }
    }
    // let mut all = true;
    // let mut ps = prime_sieve(1010101).1;
    // for &x in a.iter() {
    //     if !ps[x] {
    //         all = false;
    //         break;
    //     }
    // }

    if all {
        println!("{}", "pairwise coprime");
    } else {
        if allgcd == 1 {
            println!("{}", "setwise coprime");
        } else {
            println!("{}", "not coprime");
        }
    }
}
fn prime_factor(mut n: i64) -> std::collections::HashMap<i64, i64> {
    let mut res: std::collections::HashMap<i64, i64> = std::collections::HashMap::new();
    let mut i = 2;
    while i * i <= n {
        while n % i == 0 {
            let v = match res.get(&i) {
                Some(v) => *v + 1,
                None => 1,
            };
            res.insert(i, v);
            n /= i;
        }
        i += 1;
    }
    if n != 1 {
        res.insert(n, 1);
    }
    res
}
pub fn prime_sieve(n: usize) -> (Vec<usize>, Vec<bool>) {
    let mut prime = Vec::new();
    let mut is_prime = Vec::with_capacity(n + 1);
    is_prime.resize(n + 1, true);
    is_prime[0] = false;
    is_prime[1] = false;
    for i in 2..n + 1 {
        if is_prime[i] {
            prime.push(i);
            {
                let mut j = 2 * i;
                while j <= n {
                    is_prime[j] = false;
                    j += i;
                }
            }
        }
    }
    (prime, is_prime)
}
pub fn gcd(a: usize, b: usize) -> usize {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}
pub fn gcd_list(list: &[usize]) -> usize {
    list.iter().fold(list[0], |a, &b| gcd(a, b))
}
