#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use itertools::Itertools;
use num_integer::gcd;
use proconio::*;
use text_io::*;
use std::collections::HashSet;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

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

    let mut sum = 0;
    for &ai in &a {
        sum = gcd(sum, ai);
    }

    let max = a.iter().max().unwrap();

    let pf = prime_factorization(*max);
    let mut primes = vec![0; max + 10];

    for ai in a {
        for &p in &pf[ai] {
            primes[p] += 1;
        }
    }

    let pairwise = *primes.iter().max().unwrap() == 1;
    let setwise = sum == 1;

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

fn prime_factorization(n: usize) -> Vec<HashSet<usize>> {
    let mut v = vec![HashSet::new(); n + 10];

    for i in 2..=n {
        if v[i].len() <= 1 {
            v[i].insert(i);
            let mut j = 2;
            while i * j <= n {
                v[i * j].insert(i);
                j += 1;
            }
        }
    }

    v
}
