fn main() {
    let n: usize = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        buf.trim_end().parse().unwrap()
    };

    let a: Vec<i32> = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let iter = buf.split_whitespace();
        iter.map(|x| x.parse().unwrap()).collect()
    };

    let get_primes = |n: usize| -> Vec<i32> {
        let mut primes = Vec::new();
        let mut is_prime = vec![true; n + 1];
        for i in 2..=n {
            if !is_prime[i] { continue; }
            primes.push(i as i32);
            let mut j = i + i;
            while j <= n {
                is_prime[j] = false;
                j += i;
            }
        }
        primes
    };

    let primes = get_primes(1_000_000);

    let is_pair_wise_coprime = || -> bool {
        let mut b = a.clone();
        let mut check = vec![false; primes.len()];
        for i in 0..n {
            for (j, &p) in primes.iter().enumerate() {
                if j * j > p as usize { break; }
                if b[i] % p == 0 {
                    if check[j] {
                        return false;
                    }
                    check[j] = true;
                }
                while b[i] % p == 0 {
                    b[i] /= p;
                }
            }
            if b[i] > 1 {
                let j = primes.binary_search(&a[i]).unwrap();
                if check[j] {
                    return false;
                }
                check[j] = true;
            }
        }
        true
    };

    let gcd = |mut a: i32, mut b: i32| -> i32 {
        let mut r = a % b;
        while r > 0 {
            a = b;
            b = r;
            r = a % b;
        }
        b
    };

    if is_pair_wise_coprime() {
        println!("pairwise coprime")
    } else if (1..n).fold(a[0], |acc, i| gcd(acc, a[i])) == 1 {
        println!("setwise coprime")
    } else {
        println!("no coprime");
    }
}