use std::cmp;
use std::collections::HashSet;
use std::fmt::Debug;
use std::str::FromStr;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where
    T: FromStr,
    <T as FromStr>::Err: Debug,
{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim()
        .split_whitespace()
        .map(|c| T::from_str(c).unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_as_string() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn gcd(a: u64, b: u64) -> u64 {
    if b == 0 {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

fn calc_primes(x: u64) -> Vec<u64> {
    if x == 2 {
        return vec![2];
    }
    let mut x = x;
    let mut primes = vec![];

    for div in 2..=(x as f64).sqrt().floor() as u64 {
        if x % div == 0 {
            primes.push(div);

            while x % div == 0 {
                x /= div;
            }
        }
    }
    return primes;
}

fn is_pariwise(a: &[u64]) -> bool {
    let mut hash: HashSet<u64> = HashSet::new();
    let mut founds: Vec<bool> = vec![false; 1_000_001];
    for ax in a {
        // check if `ax` has already appeared
        if founds[(*ax) as usize] {
            return false;
        } else {
            founds[(*ax) as usize] = true;
        }

        let primes = calc_primes(*ax);
        for px in primes {
            if let Some(_) = hash.get(&px) {
                return false;
            } else {
                hash.insert(px);
            }
        }
    }
    return true;
}

fn is_setwise(a: &[u64]) -> bool {
    let mut ans = a[0];

    for elem in a {
        ans = gcd(ans, *elem);
    }

    if ans == 1 {
        true
    } else {
        false
    }
}

fn main() {
    let n: usize = read_as_vec()[0];
    let a: Vec<u64> = read_as_vec::<u64>();

    if is_pariwise(&a) {
        println!("pairwise coprime");
    } else if is_setwise(&a) {
        println!("setwise coprime");
    } else {
        println!("not coprime");
    }
}
