use proconio::{input, fastout};
use std::collections::{HashMap, HashSet};

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

    let mut ff = vec![];
    let mut is_pairwise = true;

    let primes = sieve((n as f64).sqrt().ceil() as usize);

    for &a in aa.iter() {
        ff.push(factors(a, &primes));
    }

    let mut intersection: Option<HashSet<usize>> = None;
    let mut union: Option<HashSet<usize>> = None;

    for f in ff.iter() {
        let set = f.iter().map(|(&k, _)| k).collect::<HashSet<usize>>();
        if let Some(int) = intersection {
            let new = int.intersection(&set).cloned().collect();
            intersection = Some(new);
        } else {
            intersection = Some(set.clone());
        }

        if let Some(uni) = union {
            if uni.intersection(&set).count() > 0 {
                is_pairwise = false;
            }
            let new = uni.union(&set).cloned().collect();
            union = Some(new);
        } else {
            union = Some(set.clone());
        }
    }

    if let Some(int) = intersection {
        if int.len() > 0 {
            println!("not coprime");
        } else if is_pairwise {
            println!("pairwise coprime");
        } else {
            println!("setwise coprime");
        }
    }
}

fn factors(n: usize, primes: &[usize]) -> HashMap<usize, usize> {
    let mut factors = HashMap::new();
    let mut r = n;
    for &i in primes.iter() {
        while r % i == 0 {
            *factors.entry(i).or_insert(0) += 1;
            r /= i;
        }
    }
    if r > 1 {
        *factors.entry(r).or_insert(0) += 1;
    }

    factors
}

fn sieve(n: usize) -> Vec<usize> {
    let mut primes = vec![];
    let mut is_prime = vec![true; n + 1];
    for i in 2..n+1 {
        if !is_prime[i] {
            continue;
        }
        primes.push(i);
        for j in i..n/i+1 {
            is_prime[i * j] = false;
        }
    }
    primes
}
