#![allow(unused_imports)]
#![allow(unused_macros)]
use itertools::Itertools;
use std::cmp::{max, min};
use std::collections::*;
use std::io::{stdin, Read};

trait ChMinMax {
    fn chmin(&mut self, other: Self);
    fn chmax(&mut self, other: Self);
}
impl<T> ChMinMax for T
where
    T: PartialOrd,
{
    fn chmin(&mut self, other: Self) {
        if *self > other {
            *self = other
        }
    }
    fn chmax(&mut self, other: Self) {
        if *self < other {
            *self = other
        }
    }
}

#[allow(unused_macros)]
macro_rules! parse {
    ($it: ident ) => {};
    ($it: ident, ) => {};
    ($it: ident, $var:ident : $t:tt $($r:tt)*) => {
        let $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, $var:ident $($r:tt)*) => {
        let $var = parse_val!($it, usize);
        parse!($it $($r)*);
    };
}

#[allow(unused_macros)]
macro_rules! parse_val {
    ($it: ident, [$t:tt; $len:expr]) => {
        (0..$len).map(|_| parse_val!($it, $t)).collect::<Vec<_>>();
    };
    ($it: ident, ($($t: tt),*)) => {
        ($(parse_val!($it, $t)),*)
    };
    ($it: ident, u1) => {
        $it.next().unwrap().parse::<usize>().unwrap() -1
    };
    ($it: ident, $t: ty) => {
        $it.next().unwrap().parse::<$t>().unwrap()
    };
}

#[cfg(debug_assertions)]
macro_rules! debug {
    ($( $args:expr ),*) => { eprintln!( $( $args ),* ); }
}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($( $args:expr ),*) => {
        ()
    };
}

pub fn factor(mut n: usize) -> HashMap<usize, usize> {
    let mut ret = std::collections::HashMap::new();
    let n0 = n;
    let mut cur = 2;
    while cur * cur <= n0 {
        if n % cur != 0 {
            cur += 1;
            continue;
        }
        let mut count = 0;
        while n % cur == 0 {
            n /= cur;
            count += 1;
        }
        ret.insert(cur, count);
        cur += 1;
    }
    if n > 1 {
        ret.insert(n, 1);
    }
    ret
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    parse!(it, n: usize, a: [usize; n]);
    let mut ps = vec![true; 1000];
    ps[0] = false;
    ps[1] = false;
    for i in 2..ps.len() {
        if ps[i] {
            let mut j = i * 2;
            while j < ps.len() {
                ps[j] = false;
                j += i;
            }
        }
    }
    let mut primes = vec![];
    for i in 0..ps.len() {
        if ps[i] {
            primes.push(i)
        }
    }
    let mut is_pair = true;
    let mut is_set = true;
    let mut fs = vec![0usize; primes.len()];
    let mut lp = HashMap::new();

    for &ai in &a {
        let mut ai = ai;
        for (i, &p) in primes.iter().enumerate() {
            if ai % p == 0 {
                fs[i] += 1;
                while ai % p == 0 {
                    ai /= p;
                }
            }
        }
        if ai > 1 {
            *lp.entry(ai).or_insert(0usize) += 1;
        }
    }
    for &i in &fs {
        if i == n {
            is_set = false;
            is_pair = false;
            break;
        } else if i > 1 {
            is_pair = false;
        }
    }
    for (k, i) in lp {
        if i == n {
            is_set = false;
            is_pair = false;
            break;
        } else if i > 1 {
            is_pair = false;
        }
    }

    if is_pair {
        println!("{}", "pairwise coprime");
    } else if is_set {
        println!("{}", "setwise coprime");
    } else {
        println!("{}", "not coprime");
    }
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}


Measured memory_bytes: 19916