use proconio::input;

fn main() {
    input! {
        n: usize,
        a: [usize; n],
    }

    let max = a.iter().fold(0, |max, &x| max.max(x));
    let mut primes = Vec::new();
    let (mut is_prime, mut spf) = (vec![true; max + 1], vec![0; max + 1]);
    for i in 0..=max {
        if i < 2 {
            is_prime[i] = false;
            spf[i] = i;
        }
        if is_prime[i] {
            primes.push(i);
            spf[i] = i;
        }
        for &p in primes.iter() {
            if i * p > max || p > spf[i] {
                break;
            }
            is_prime[i * p] = false;
            spf[i * p] = p;
        }
    }

    let mut flag = false;
    let mut set = std::collections::HashSet::new();
    for &ai in a.iter() {
        let mut prev = 0;
        let mut remain = ai;
        while remain > 1 {
            if prev != spf[remain] {
                flag = flag || set.contains(&spf[remain]);
                set.insert(spf[remain]);
            }
            remain = remain / spf[remain];
            prev = spf[remain];
        }
        if flag {
            break;
        }
    }
    if !flag {
        println!("pairwise coprime");
        std::process::exit(0);
    }

    let mut a = a;
    while a.len() > 1 {
        let (mut x, mut y) = (a.pop().unwrap(), a.pop().unwrap());
        while x != y {
            let next = (x.min(y), x.max(y) - x.min(y));
            x = next.0;
            y = next.1;
        }
        a.push(x);
    }

    if a[0] == 1 {
        println!("setwise coprime");
    } else {
        println!("not coprime");
    }
}
