use std::collections::HashMap;
fn main() {
    input! {
        n: i32,
        a: [i32;n]
    }

    let mut primes = get_primes(1000);
    let mut is_pair = true;
    let mut is_set = true;
    let mut p_map: HashMap<usize, bool> = HashMap::new();
    let mut set_gcd = a[0];
    for i in a {
        if is_pair {
            for p in &primes {
                if i % (*p) as i32 == 0 {
                    if p_map.contains_key(&p) && p_map[&p] {
                        is_pair = false;
                    } else {
                        p_map.insert(*p, true);
                    }
                }
            }
        }

        set_gcd = gcd(set_gcd, i);
    }

    is_set = set_gcd == 1;
    if is_pair {
        println!("pairwise coprime");
        return;
    }
    if is_set {
        println!("setwise coprime");
        return;
    }

    println!("not coprime")
}

fn get_primes(n: usize) -> Vec<usize> {
    let mut table: Vec<_> = (2..n + 1).collect();
    let mut primes = Vec::new();

    for i in 0..table.len() {
        if table[i] != 0 {
            primes.push(table[i]);
            for j in i..table.len() {
                if i != j {
                    if table[j] % table[i] == 0 {
                        table[j] = 0;
                    }
                }
            }
            table[i] = 0;
        }
    }
    primes
}

fn gcd(a: i32, b: i32) -> i32 {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}

#[macro_export(local_inner_maccros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[macro_export(lcal_inner_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[macro_export(lcal_inner_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
