// -*- coding:utf-8-unix -*-

use proconio::{fastout, input};
use std::collections::BTreeSet;

#[fastout]
fn main() {
    input! {
        n: usize,
        mut a: [usize; n],
    }
    a.sort_unstable();
    let a = a;

    let mut setwise_gcd = a[0];
    for i in 2..=n {
        setwise_gcd = gcd(setwise_gcd, a[i - 1]);
    }
    if setwise_gcd > 1 {
        println!("not coprime");
        return;
    }

    let mut nononecount = 0;
    for &ai in &a {
        if ai == 1 {
            continue;
        }
        nononecount += 1;
    }
    if nononecount > 78498 {
        println!("setwise coprime");
        return;
    }

    // Sieve of Eratosthenes
    const PMAX: usize = 1000000;
    let mut is_prime: Vec<bool> = vec![true; PMAX];
    is_prime[0] = false;
    is_prime[1] = false;
    let mut primes_vec: Vec<usize> = Vec::new();
    for i in 2..PMAX {
        if is_prime[i] {
            for j in i..=(PMAX - 1) / i {
                is_prime[i * j] = false;
            }
            primes_vec.push(i);
        }
    }
    let _ = is_prime;
    let primes_vec = primes_vec;

    let mut already_got = vec![false; primes_vec.len()];

    for &ai in &a {
        if ai == 1 {
            continue;
        }
        // match primes_vec.binary_search(&ai) {
        //     Ok(i) => {
        //         if already_got[i] {
        //             println!("setwise coprime");
        //             return;
        //         } else {
        //             already_got[i] = true;
        //         }
        //         continue;
        //     }
        //     Err(_) => {}
        // }

        for i in 0..primes_vec.len() {
            let p = primes_vec[i];
            if p > ai {
                continue;
            }
            if ai % p == 0 {
                if already_got[i] {
                    println!("setwise coprime");
                    return;
                } else {
                    already_got[i] = true;
                }
            }
        }
    }
    println!("pairwise coprime");
}

fn gcd(m: usize, n: usize) -> usize {
    if m < n {
        return gcd(n, m);
    } else if n == 0 {
        return m;
    } else {
        return gcd(n, m % n);
    }
}
