use proconio::input;

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

    const AMAX: usize = 1_000_000;

    let mut div = vec![0; AMAX + 1];
    for i in 2..=AMAX {
        if div[i] == 0 {
            div[i] = i;
        }
        let j = i + div[i];
        if j <= AMAX && div[j] == 0 {
            div[j] = div[i];
        }
    }

    let mut cnt = vec![0; AMAX + 1];
    for &a in &a {
        cnt[a] += 1;
    }
    for i in (2..=AMAX).rev() {
        if div[i] == i {
            continue;
        }
        let j = i / div[i];
        cnt[j] += cnt[i];
        if div[j] != div[i] {
            cnt[div[i]] += cnt[i];
        }
    }

    let primes = (2..=AMAX).filter(|&i| div[i] == i);
    let pairwise = primes.clone().all(|i| cnt[i] <= 1);
    let setwise = primes.clone().all(|i| cnt[i] < n);

    println!(
        "{}",
        if pairwise {
            "pairwise coprime"
        } else if setwise {
            "setwise coprime"
        } else {
            "not coprime"
        }
    );
}
