use proconio::input;
use std::collections::HashSet;
use std::mem;

fn main() {
    input! {
        n: usize,
        r#as: [usize; n],
    }

    if is_pairwise(&r#as) {
        println!("pairwise coprime");
    } else if r#as.into_iter().fold(0, num::integer::gcd) == 1 {
        println!("setwise coprime");
    } else {
        println!("not coprime");
    }
}

fn is_pairwise(r#as: &[usize]) -> bool {
    if r#as.iter().any(|&a| a == 1)
        || r#as.iter().copied().collect::<HashSet<_>>().len() != r#as.len()
    {
        return false;
    }

    let primes = {
        let mut primes = vec![true; 1_000_001];
        primes[0] = false;
        primes[1] = false;
        for x in 2..=1000 {
            if primes[x] {
                let mut y = 2 * x;
                while y <= 1_000_000 {
                    primes[y] = false;
                    y += x;
                }
            }
        }

        primes
            .into_iter()
            .enumerate()
            .filter(|&(_, p)| p)
            .map(|(v, _)| v)
            .collect::<Vec<_>>()
    };

    for &prime in &primes[..300] {
        let mut matched = 0;
        for &a in r#as {
            if a % prime == 0 {
                matched += 1;
            }
        }
        if matched > 1 {
            return false;
        }
    }

    let mut large_factors = vec![false; 1_000_001];

    for &a in r#as {
        let mut a = a;
        for &prime in &primes[..300] {
            while a % prime == 0 {
                a /= prime;
            }
        }
        if a > 1000 && mem::replace(&mut large_factors[a], true) {
            return false;
        }
    }

    true
}
