#![allow(unused_imports)]
use proconio::{input, fastout};
use proconio::marker::*;
use im_rc::HashSet;

#[fastout]
fn main() {
    input! {
    n: usize,
    a: [usize; n]
    }
    let mut l2 = vec![true; 1000005];
    let set_a : HashSet<usize>= HashSet::from(a.clone());
    let mut is_pc = true;
    for i in 2..=1000 {
        let mut count = 0;
        if l2[i] {
            for j in 1.. {
                let k = i * j;
                if k > 1000000 {
                    break;
                };
                if set_a.contains(&k) {
                    count += 1;
                }
                l2[k] = false;
            }
            if count >= 2 {
                is_pc = false;
                break;
            }
        }
    }
    if is_pc {
        print!("pairwise coprime");
        return
    }
    let mut t = a[0];
    for i in 0..n {
        t = gcd(&a[i], &t);
    }
    if t == 1 {
        print!("setwise coprime");
        return
    }
    print!("not coprime")
}

// O(log(N))
fn gcd(a: &usize, b: &usize) -> usize {
    let (mut x, mut y) = if a < b { (*b, *a) } else { (*a, *b) };
    let mut r = x % y;
    while r != 0 {
        x = y;
        y = r;
        r = x % y;
    }
    y
}

