use proconio::{input, fastout};

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

    let mut prime_list = Vec::new();
    let limit = 1_000_000f32.sqrt() as usize;
    for i in 2..limit {
        prime_list.push(i);
    }

    for i in 2..limit {
        prime_list = prime_list.into_iter().filter(|&n| n%i != 0 || n == i).collect::<Vec<usize>>();
    }

    let mut memo = vec![0usize; prime_list.len()];
    for v in a.iter() {
        for (i, p) in prime_list.iter().enumerate() {
            if v%p == 0 {
                memo[i] += 1;
            }
        }
    }

    let mut pc = true;
    let mut sc = false;
    
    let ones = a.iter().filter(|&&n| n == 1).count();
    for &i in memo.iter() {
        if i == 0 {
            continue;
        }

        if i > 1 {
            pc = false;
        }
        if i == a.len()-1-ones {
            sc = true;
        }
    }

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