use proconio::input;
use proconio::marker::Chars;
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused)]
const ALPHA_SMALL: [char; 26] = [
    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
    't', 'u', 'v', 'w', 'x', 'y', 'z',
];
#[allow(unused)]
const ALPHA: [char; 26] = [
    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
    'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
];

use std::collections::HashSet;
const SIZE: usize = 1_000_000;
fn main() {
    input!(N: usize);
    input!(mut A: [usize; N]);
    let mut flag1 = true;
    let mut flag2 = true;
    let set: HashSet<usize> = A.clone().into_iter().collect();
    let mut check = vec![false; SIZE + 1];
    for i in 2..=SIZE {
        let mut j = i;
        let mut cnt = 0;
        while j <= SIZE {
            check[j] = true;
            j += i;
            if set.contains(&j) {
                cnt += 1;
            }
        }

        if cnt > 1 {
            flag1 = false;
            break;
        }
    }

    let mut t = A[0];
    for i in 0..N {
        t = gcd(t, A[i]);
    }
    if t != 1 {
        flag2 = false;
    }
    // println!("{}", t);

    if flag1 {
        println!("pairwise coprime");
    } else if !flag1 && flag2 {
        println!("setwise coprime");
    } else {
        println!("not coprime");
    }
}

fn gcd(a: usize, b: usize) -> usize {
    if b > a {
        gcd(b, a);
    }

    if a % b == 0 {
        return b;
    }

    let r: usize = a % b;

    return gcd(b, r);
}
