#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use itertools::Itertools;
use num_traits::clamp;
use ordered_float::OrderedFloat;
use proconio::{input, marker::*, fastout};
use superslice::*;

fn main() {
     //pairwise coprime ならば pairwise coprime、
     //setwise coprime ならば setwise coprime、
     //そのどちらでもなければ not coprime と出力せよ
    input! {
        n: usize,
        a: [usize; n],
    }

    let mut g = a[0];
    for i in 1..n {
        g = gcd(g as u64, a[i] as u64) as usize;
    }
    if g != 1 {
        println!("not coprime");
        return;
    }

    let factors = factor_table(100_001);
    let mut fset = HashSet::new();
    for i in 0..n {
        let mut num = a[i];
        while num != 1 {
            let p = factors[num];
            if !fset.contains(&p) {
                fset.insert(p);
                while num % p == 0 {
                    num /= p;
                }
            } else {
                println!("setwise coprime");
                return;
            }
        }
    }
    println!("pairwise coprime");
}
#[allow(dead_code)]
pub fn gcd(a: u64, b: u64) -> u64 {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}
#[allow(dead_code)]
pub fn lcm(a: u64, b: u64) -> u64 {
    a / gcd(a, b) * b
}
#[allow(dead_code)]
/// (gcd, x, y)
pub fn extgcd(a: i64, b: i64) -> (i64, i64, i64) {
    if b == 0 {
        (a, 1, 0)
    } else {
        let (gcd, x, y) = extgcd(b, a % b);
        (gcd, y, x - (a / b) * y)
    }
}

#[allow(dead_code)]
pub fn factor_table(max_n: usize) -> Vec<usize> {
    let mut res = vec![0; max_n + 1];
    for i in 2..max_n + 1 {
        if res[i] == 0 {
            let mut j = i;
            while j <= max_n {
                res[j] = i;
                j += i;
            }
        }
    }
    res
}