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

use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;
use num::*;
use num_traits::*;
use superslice::*;
use std::ops::*;

use itertools::Itertools;
use itertools_num::ItertoolsNum;

pub fn gcd<T: PrimInt>(a: T, b: T) -> T {
    if b == zero() {
        a
    } else {
        gcd(b, a % b)
    }
}
pub fn gcd_list<T: PrimInt>(vec: Vec<T>) -> T {
    assert!(vec.len() > 1);
    vec.iter().fold(vec[0], |acc, x| gcd(*x, acc))
}

#[fastout]
fn solve() {
    const MOD: usize = 1_000_000_007;
    const INF: usize = std::usize::MAX;
    
    input!{
        n: usize,
        a_vec: [usize; n]
    }

    let mut cum_gcd_left = vec![0; n+1];
    let mut cum_gcd_right = vec![0; n+1];

    for i in 0..n {
        cum_gcd_left[i+1] = gcd(cum_gcd_left[i], a_vec[i]);
        cum_gcd_right[n-i-1] = gcd(cum_gcd_right[n-i], a_vec[n-i-1]);
    }

    let mut is_pairprime = true;

    for i in 0..n-1 {
        if gcd(a_vec[i], cum_gcd_right[i+1]) != 1 {
            is_pairprime = false;
            break;
        }
    }
    
    if is_pairprime {
        println!("pairwise coprime")
    } else if gcd_list(a_vec) == 1 {
        println!("setwise coprime")
    } else {
        println!("not coprime")
    }

    println!("", );
}

fn main() {
    solve()
}

#[cfg(test)]
mod test {
    use super::solve;
}
