#![allow(unused_imports)]

use proconio::{input, fastout};
use proconio::marker::*;
use im_rc::HashSet;

#[fastout]
fn main() {
    input! {
    n: usize,
    mut a: [usize; n]
    }
    a.sort();
    let mut l2 = vec![true; 1000005];
    let set_a: HashSet<usize> = HashSet::from(a.clone());
    let mut is_pc = true;
    for i in 2..=1000 {
        let mut count = 0;
        if l2[i] {
            for j in 1.. {
                let k = i * j;
                if k > 1000000 {
                    break;
                };
                if set_a.contains(&k) {
                    count += a.upper_bound(&k) - a.lower_bound(&k);
                }
                l2[k] = false;
            }
            if count >= 2 {
                is_pc = false;
                break;
            }
        }
    }
    if is_pc {
        print!("pairwise coprime");
        return;
    }
    let mut t = a[0];
    for i in 0..n {
        t = gcd(&a[i], &t);
    }
    if t == 1 {
        print!("setwise coprime");
        return;
    }
    print!("not coprime")
}

// O(log(N))
fn gcd(a: &usize, b: &usize) -> usize {
    let (mut x, mut y) = if a < b { (*b, *a) } else { (*a, *b) };
    let mut r = x % y;
    while r != 0 {
        x = y;
        y = r;
        r = x % y;
    }
    y
}

use std::cmp::Ordering;

pub trait BinarySearch<T> {
    fn lower_bound(&self, x: &T) -> usize;
    fn upper_bound(&self, x: &T) -> usize;
}

impl<T: Ord> BinarySearch<T> for [T] {
    fn lower_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (high + low) / 2;
            match self[mid].cmp(x) {
                Ordering::Less => {
                    low = mid + 1;
                }
                Ordering::Equal | Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
    fn upper_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();
        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less | Ordering::Equal => {
                    low = mid + 1;
                }
                Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
}

