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

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

    let mut ff = vec![];
    let mut is_pairwise = true;
    let mut g = aa[0];

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

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

    let mut used = vec![false; 1_000_001];
    for f in ff.iter() {
        for (&k, _) in f.iter() {
            if used[k] {
                is_pairwise = false;
            }
            used[k] = true;
        }
    }


    if g != 1 {
        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();
    for &i in primes.iter() {
        if n % i == 0 {
            *factors.entry(i).or_insert(0) += 1;
        }
    }
    if factors.is_empty() && n > 1 {
        *factors.entry(n).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 1..n/i+1 {
            is_prime[i * j] = false;
        }
    }
    primes
}

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