extern crate num_traits;
/// input macro from https://qiita.com/tanakh/items/1ba42c7ca36cd29d0ac8
macro_rules ! read_value {($ next : expr , ($ ($ t : tt ) ,* ) ) => {($ (read_value ! ($ next , $ t ) ) ,* ) } ; ($ next : expr , [$ t : tt ; $ len : expr ] ) => {(0 ..$ len ) . map (| _ | read_value ! ($ next , $ t ) ) . collect ::< Vec < _ >> () } ; ($ next : expr , chars ) => {read_value ! ($ next , String ) . chars () . collect ::< Vec < char >> () } ; ($ next : expr , usize1 ) => {read_value ! ($ next , usize ) - 1 } ; ($ next : expr , $ t : ty ) => {$ next () . parse ::<$ t > () . expect ("Parse error" ) } ; }
macro_rules ! input_inner {($ next : expr ) => {} ; ($ next : expr , ) => {} ; ($ next : expr , $ var : ident : $ t : tt $ ($ r : tt ) * ) => {let $ var = read_value ! ($ next , $ t ) ; input_inner ! {$ next $ ($ r ) * } } ; }
macro_rules ! input {(source = $ s : expr , $ ($ r : tt ) * ) => {let mut iter = $ s . split_whitespace () ; let mut next = || {iter . next () . unwrap () } ; input_inner ! {next , $ ($ r ) * } } ; ($ ($ r : tt ) * ) => {let stdin = std :: io :: stdin () ; let mut bytes = std :: io :: Read :: bytes (std :: io :: BufReader :: new (stdin . lock () ) ) ; let mut next = move || -> String {bytes . by_ref () . map (| r | r . unwrap () as char ) . skip_while (| c | c . is_whitespace () ) . take_while (| c |! c . is_whitespace () ) . collect () } ; input_inner ! {next , $ ($ r ) * } } ; }

macro_rules ! rough_print {($ x : expr $ (, $ s : expr ) * ) => {print ! ("{:?}" , $ x ) ; $ (print ! (", {:?}" , $ s ) ; ) * println ! ("" ) ; } ; }

fn gcd<T>(a: T, b: T) -> T
where
    T: num_traits::PrimInt,
{
    if b == T::from(0).unwrap() {
        a
    }
    else {
        gcd(b, a % b)
    }
}
fn gcd_list<T>(list: &[T]) -> T
where
    T: num_traits::PrimInt,
{
    list.iter().fold(list[0], |a, &b| gcd(a, b))
}

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

    if gcd_list(&a) != 1 {
        println!("not coprime");
        return;
    }

    let a_max = *(a.iter().max().unwrap());
    let mut elist: Vec<usize> = (0..=a_max).collect();
    for i in 2..=a_max {
        if elist[i] == i {
            let mut j = 2;
            while (i * j) < a_max {
                if elist[i * j] > i {
                    elist[i * j] = i;
                }
                j += 1;
            }
        }
    }

    let mut divided = vec![false; a_max + 1];
    for &_ai in &a {
        let mut ai = _ai;

        while elist[ai] != ai {
            let p = elist[ai];

            while elist[ai] == p {
                ai /= p;
            }

            if divided[p] {
                println!("setwise coprime");
                return;
            }

            divided[p] = true;
        }

        if (ai != 1) && (ai != 0) {
            if divided[ai] {
                println!("setwise coprime");
                return;
            }

            divided[ai] = true;
        }
    }

    println!("pairwise coprime");
}

fn main() {
    std::thread::Builder::new()
        .name("solve".into())
        .stack_size(256 * 1024 * 1024)
        .spawn(solve)
        .unwrap()
        .join()
        .unwrap();
}
