// EbTech's Rust template. Thanks EbTech!
#![allow(unused_imports)]
use std::cmp::{max, min, Reverse};
use std::collections::{HashMap, HashSet};
use std::io::{self, prelude::*};
use std::str;

/*
5 2
5 -4 4 3 -5
4 3
3 -1

5 -4 4 3 -5 -> 8
5 -4 4 3 3  -> 11
5 -4 4 -1 3 -> 7
*/

struct Scanner<R> {
    reader: R,
    buf_str: Vec<u8>,
    buf_iter: str::SplitWhitespace<'static>,
}
impl<R: BufRead> Scanner<R> {
    fn new(reader: R) -> Self {
        Self {
            reader,
            buf_str: vec![],
            buf_iter: "".split_whitespace(),
        }
    }
    fn next<T: str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buf_iter.next() {
                return token.parse().ok().expect("Failed parse");
            }
            self.buf_str.clear();
            self.reader
                .read_until(b'\n', &mut self.buf_str)
                .expect("Failed read");
            self.buf_iter = unsafe {
                let slice = str::from_utf8_unchecked(&self.buf_str);
                std::mem::transmute(slice.split_whitespace())
            }
        }
    }
}

fn solve<R: BufRead, W: Write>(scan: &mut Scanner<R>, w: &mut W) {
    let n: usize = scan.next();
    let mut v = vec![0; n];
    for i in 0..n {
        v[i] = scan.next::<usize>();
    }
    let v = v;
    const N: usize = 0 as usize + 100;
    let mut is_prime = vec![true; N];
    is_prime[0] = false;
    is_prime[1] = false;
    let mut fac = vec![1; N];
    for i in 2..N {
        if is_prime[i] {
            fac[i] = i;
            for j in (2 * i..N).step_by(i) {
                is_prime[j] = false;
                fac[j] = i;
            }
        }
    }

    let mut seen = HashSet::new();
    let mut proceed = false;
    'main: for i in 0..n {
        let mut e = v[i];
        let mut vec = Vec::with_capacity(50);
        while fac[e] != 1 {
            if seen.get(&fac[e]).is_some() {
                proceed = true;
                break 'main;
            }
            vec.push(fac[e]);
            e /= fac[e];
        }
        for e in vec {
            seen.insert(e);
        }
    }
    if proceed {
        let mut v = v;
            let mut se = fac[v[0]];
            for i in 0..n {
                se = min(se, fac[v[i]]);
            }
            if se == 1 {
                println!("setwise coprime");
                return;
            }
            for i in 0..n {
                if v[i] % se != 0 {
                    println!("setwise coprime");
                    return;
                }
                v[i] /= se;
            }
        println!("not coprime");
    } else {
        println!("pairwise coprime");
    }
}

fn main() {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = Scanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());
    // let t: u64 = scan.next();
    let t = 1;
    for _ in 0..t {
        solve(&mut scan, &mut out);
    }
}
