use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn gcd(mut a: usize, mut b: usize) -> usize {
    if a<b {
        let mut tmp = a;
        a = b;
        b = tmp;
    } 
    let mut r = a % b;
    while r!=0 {
        a = b;
        b = r;
        r = a % b;
    }
    b
}

#[fastout]
fn main() {
    input!{
        n: usize,
        a: [usize;n],
    }
    
    let mut primes: Vec<usize> = vec![0;1000_000];
    // let mut primes: Vec<usize> = vec![0;6];
    let mut ok = true;
    for i in 0..n {
        let s = (a[i] as f64).sqrt().ceil() as usize;
        for j in 2..s+1 {
            let mut ret = 0;
            let mut a_tmp = a[i];
            if a[i]%j==0 {
                while a_tmp%j==0 {
                    a_tmp /= j;
                }
                if primes[j]!=0 || primes[a_tmp]!=0 {
                    ok = false;
                    break;
                } else if primes[j]==0 {
                    primes[j] += 1;
                } else if primes[a_tmp]==0 {
                    primes[a_tmp] += 1;
                }
            }
        }
        if ok==false {
            break;
        }
    }
    // debug!(primes);

    if ok==true {
        println!("pairwise coprime");
        return;
    } else {
        let mut ret = a[0];
        for i in 1..n {
            ret = gcd(ret, a[i]);
        }
        if ret==1 {
            println!("setwise coprime");
        } else {
            println!("not coprime");
        }
    }

}
