mod prime_number {

use std::iter::Iterator;

type ValueType = usize;

pub struct PrimeFactorization {
    n: ValueType,
    cur: ValueType,
    limit: ValueType,
}

///素因数分解
impl PrimeFactorization {
    ///素因数を計算するイテレータを返す。
    pub fn calc(n: ValueType) -> PrimeFactorization {
        PrimeFactorization {
            n: n,
            cur: 1,
            limit: n,
        }
    }
}

impl Iterator for PrimeFactorization {
    type Item = ValueType;
    fn next(&mut self) -> Option<Self::Item> {
        loop {
            if self.cur == 0 || self.cur > self.n {
                return None;
            }

            self.cur += 1;

            if self.cur * self.cur > self.limit {
                if self.n != 1 {
                    self.cur = 0;
                    return Some(self.n);
                }
                return None;
            }
            if self.n % self.cur == 0 {
                while self.n % self.cur == 0 {
                    self.n /= self.cur;
                }
                self.cur -= 1;
                return Some(self.cur + 1);
            }
        }
    }
}

}
use proconio::{
    fastout, input,
    marker::{Bytes, Chars, Isize1, Usize1},
};

use prime_number::*;

use num::integer::gcd;
const INF: usize = 999999999999;
fn main() {
    input! {
        n:usize,
        a:[usize;n]
    }

    let mut sc = a[0];
    for i in 1..a.len() {
        sc = gcd(sc, a[i]);
    }
    let mut is_sc = sc == 1;
    let mut is_pc = true;
    let mut arr = vec![INF; 1000001];
    let mut idx = 0;
    for &i in &a {
        for q in PrimeFactorization::calc(i) {
            if arr[q] != idx && arr[q] != INF {
                is_pc = false;
            }
            arr[q] = idx;
        }
        idx += 1;
    }
    if is_pc {
        println!("pairwise coprime");
    } else if is_sc {
        println!("setwise coprime");
    } else {
        println!("not coprime");
    }
}


