use proconio::input;
use std::collections::BTreeSet;

fn main() {
    input! {
        n: usize,
        v: [usize; n]
    }

    let (set,max) = {
        let mut max = 1;
        let mut set = BTreeSet::new();
        for &x in &v {
            set.insert(x);
            if max < x {
                max = x;
            }
        }
        (set,max)
    };


    let flag = {
        let mut flag = false;

        let mut tbl = vec![true; max+1];
        tbl[0] = false;
        tbl[1] = false;
        for i in 2..=max {
            if flag {
                break;
            }
            if tbl[i] {
                let mut j = i+i;
                let mut ff = false;
                if set.contains(&i) {
                    ff = true;
                }
                while j < max {
                    tbl[j] = false;
                    if !ff && set.contains(&j) {
                        ff = true;
                    } else if ff && set.contains(&j) {
                        flag = true;
                        break;
                    }
                    j += i;
                }
            }
        }

        flag
    };


    if !flag {
        println!("pairwise coprime")
    } else {
        let mut jj = v[0];
        for i in 1..n {
            jj = num::integer::gcd(jj,v[i]);
        }
        if jj == 1 {
            println!("setwise coprime")
        } else {
            println!("not coprime")
        }
    }
}