use proconio::{fastout, input};

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

    let mut do_continue = true;
    let mut ans = "pairwise coprime";
    let erasuto = sieve(1_000_000f64.sqrt() as usize + 1);
    let mut aaa: Vec<usize> = a.to_vec();

    for i in erasuto {
        let mut d_count = 0;
        for j in 0..n {
            if a[j] % i == 0 {
                d_count += 1;
                aaa[j] = i;
            }
        }
        if d_count > 1 {
            do_continue = false;
            ans = "not coprime";
        }
    }
    if do_continue {
        for i in 0..n {
            if aaa[i] == 1 {
                continue;
            }
            let mut d_count = 0;
            for j in 0..n {
                if a[j] % aaa[i] == 0 {
                    d_count += 1;
                }
            }
            if d_count > 1 {
                do_continue = false;
                ans = "not coprime";
                break;
            }
        }
    }

    if !do_continue {
        let mut c = a[0];
        for i in 1..n {
            c = num::integer::gcd(c, a[i]);
        }
        if c == 1 {
            ans = "setwise coprime";
        }
    }

    println!("{}", ans);
}

fn sieve(n: usize) -> Vec<usize> {
    let mut ps: Vec<usize> = vec![2];
    let mut xs: Vec<bool> = vec![true; n / 2];
    let mut x = 3;
    while x * x <= n {
        let mut y = (x - 3) / 2;
        if xs[y] {
            ps.push(x);
            y += x;
            while y < xs.len() {
                xs[y] = false;
                y += x;
            }
        }
        x += 2;
    }
    while x <= n {
        if xs[(x - 3) / 2] {
            ps.push(x);
        }
        x += 2;
    }
    ps
}
