#![allow(unused_imports)]
#![allow(non_snake_case)]
#![allow(dead_code)]
use proconio::marker::*;
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize,
        ar: [usize; n],
    }

    let res = solve(&ar);
    match res {
        Coprime::Not => print!("not"),
        Coprime::Pairwise => print!("pairwise"),
        Coprime::Setwise => print!("setwise"),
    }
    println!(" coprime")
}

enum Coprime {
    Not,
    Pairwise,
    Setwise,
}

fn solve(ar: &[usize]) -> Coprime {
    let max = ar.iter().max().unwrap();
    let mut prime: Vec<_> = (0..=*max).collect();
    for i in 2..=*max / 2 {
        if prime[i] == i {
            for k in (i..=*max).step_by(i) {
                if prime[k] > i {
                    prime[k] = i;
                }
            }
        }
    }

    let mut pcou = vec![0; *max + 1];
    if !ar.iter().any(|a| {
        let mut p = *a;
        if p == prime[p] {
            pcou[p] += 1;
        } else {
            while p > prime[p] {
                pcou[prime[p]] += 1;
                if pcou[prime[p]] >= 2 {
                    return true;
                }
                p /= prime[p];
            }
        }
        false
    }) {
        Coprime::Pairwise
    } else {
        let iter = ar.into_iter();
        let tmp = iter.fold(0, |acc, &x| if acc > x { gcd(acc, x) } else { gcd(x, acc) });
        if tmp == 1 {
            Coprime::Setwise
        } else {
            Coprime::Not
        }
    }
}

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