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

use proconio::*;
use text_io::*;

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

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

    let is_set_wise = a.iter().fold(0, |a, &b| gcd(a, b)) <= 1;
    let &max = a.iter().max().unwrap();

    let eratosthenes = Eratosthenes::new(max);
    let mut divisors = vec![0; max + 1];

    for ai in a {
        let prime_factors = eratosthenes.factorization(ai);
        for (prime_factor, _amount) in prime_factors {
            divisors[prime_factor] += 1;
        }
    }

    let is_pair_wise = *divisors.iter().max().unwrap() <= 1;

    println!(
        "{}",
        if is_pair_wise {
            "pairwise coprime"
        } else if is_set_wise {
            "setwise coprime"
        } else {
            "not coprime"
        }
    );
}


use itertools::Itertools;
use std::collections::HashMap;
use num::integer::gcd;

/// 二分累乗法
pub fn pow(x: isize, n: usize) -> isize {
    if n == 0 {
        1
    } else if n == 1 {
        x
    } else if n % 2 == 1 {
        x * pow(x, n - 1)
    } else {
        pow(x * x, n / 2)
    }
}

/// エラトステネスの篩
/// 構築 O(N log log N)
/// 素因数分解 O(log N)
/// 素数判定 O(log N)
pub struct Eratosthenes {
    smallest_prime_factors: Vec<usize>,
}

impl Eratosthenes {
    pub fn new(n: usize) -> Self {
        let mut smallest_prime_factors = (0..=n).collect_vec();
        
        for i in 2.. {
            if i * i > n || smallest_prime_factors[i] != i {
                break;
            }
            
            let mut j = i * 2;
            while j <= n {
                if smallest_prime_factors[j] == j {
                    smallest_prime_factors[j] = i;
                }
                
                j += i;
            }
        }
        
        Self {
            smallest_prime_factors,
        }
    }
    
    pub fn factorization(&self, mut i: usize) -> HashMap<usize, usize> {
        assert_ne!(i, 0);
        
        let mut factors = HashMap::new();
        
        while i != 1 {
            let divisor = self.smallest_prime_factors[i];
            *factors.entry(divisor).or_insert(0) += 1;
            
            i /= divisor;
        }
        
        factors
    }
    
    pub fn is_prime(&self, i: usize) -> bool {
        i >= 2 && self.smallest_prime_factors[i] == i
    }
}
