use std::fmt::Debug;
use std::str::FromStr;

pub struct TokenReader {
    reader: std::io::Stdin,
    tokens: Vec<String>,
    index: usize,
}

impl TokenReader {
    pub fn new() -> Self {
        Self {
            reader: std::io::stdin(),
            tokens: Vec::new(),
            index: 0,
        }
    }

    pub fn next<T>(&mut self) -> T
    where
        T: FromStr,
        T::Err: Debug,
    {
        if self.index >= self.tokens.len() {
            self.load_next_line();
        }
        self.index += 1;
        self.tokens[self.index - 1].parse().unwrap()
    }

    pub fn vector<T>(&mut self) -> Vec<T>
    where
        T: FromStr,
        T::Err: Debug,
    {
        if self.index >= self.tokens.len() {
            self.load_next_line();
        }
        self.index = self.tokens.len();
        self.tokens.iter().map(|tok| tok.parse().unwrap()).collect()
    }

    pub fn load_next_line(&mut self) {
        let mut line = String::new();
        self.reader.read_line(&mut line).unwrap();

        self.tokens = line
            .split_whitespace()
            .map(String::from)
            .collect();
        self.index = 0;
    }
}

enum Res {
    Pairwise,
    Setwise,
    NotCoprime
}

fn gcd(a: i32, b: i32) -> i32 {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}

fn add_mask(mut num: i32, count: &mut Vec<i32>) {
    let mut factor = 2;
    while factor <= num / factor {
        if num % factor == 0 {
            count[factor as usize] += 1;
        }
        while num % factor == 0 {
            num /= factor;
        }
        factor += 1;
    }
}

fn solve(nums: &Vec<i32>) -> Res {
    let mut all_gcd = nums[0];
    let mut count = vec![0; 1e6 as usize + 2];

    for &num in nums.iter() {
        all_gcd = gcd(all_gcd, num);
        add_mask(num, &mut count);
    }

    if count.into_iter().all(|x| x < 2) {
        Res::Pairwise
    } else if all_gcd == 1 {
        Res::Setwise
    } else {
        Res::NotCoprime
    }
}

fn main() {
    let mut reader = TokenReader::new();
    let _ = reader.next::<usize>();
    let nums = reader.vector();

    match solve(&nums) {
        Res::Pairwise => println!("pairwise coprime"),
        Res::Setwise => println!("setwise coprime"),
        Res::NotCoprime => println!("not coprime"),
    }
}