#![allow(non_snake_case,unused_imports,dead_code)]
use std::str::FromStr;
use std::collections::{HashMap,HashSet,VecDeque,BinaryHeap};
use std::cmp::{max,min,Reverse,Ordering};
use std::time::{Duration, Instant};
use rand::Rng;
 
use proconio::input;
use proconio::marker::{Chars,Usize1,Isize1};

fn main() {
    input!{
        N:usize,
        mut A:[usize;N],
    }
    A.sort_by_key(|&x| -(x as isize));

    let mut all_gcd = A[0];
    for &a in &A[1..]{
        all_gcd = gcd(all_gcd,a);
    }
    if all_gcd != 1{
        println!("not coprime");
        return;
    }

    if A.is_empty(){
        println!("pairwise coprime");
        return;
    }
    while A[A.len()-1] == 1{
        A.pop();
    }
    let N = A.len();
    let primes = get_primes(1_000_000);
    if N > primes.len(){
        println!("setwise coprime");
        return;
    }
    let mut primes = primes.iter().collect::<Vec<_>>();
    primes.sort();

    let mut facs = HashSet::new();
    for &a in &A{
        let mut a = a;
        for &&p in &primes{
            if p*p > a{
                if facs.contains(&a){
                    println!("setwise coprime");
                    return;
                }
                facs.insert(a);
                break;
            }
            if a%p == 0{
                if facs.contains(&p){
                    println!("setwise coprime");
                    return;
                }
                facs.insert(p);
                while a%p == 0{
                    a /= p;
                }
            }
        }

    }

    println!("pairwise coprime");

}

fn gcd(x:usize,y:usize) -> usize{
    if y==0{return x;}
    gcd(y,x%y)
}

fn get_primes(n:usize)->HashSet<usize>{
    //n以下の素数のHashSetを返す
        let mut ret = HashSet::new();
        let mut checked = vec![false;n+1];
        for i in 2..=n{
            if checked[i] {continue;}
            ret.insert(i);
            for j in 1..=(n/i){
                checked[i*j] = true;
            }
        }
        ret
    }