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

#[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 pex = vec![false; *max + 1];
    if !ar.iter().any(|a| {
        let mut pset = HashSet::with_capacity(*a);
        let mut p = *a;
        while p > 1 {
            pset.insert(prime[p]);
            p /= prime[p];
        }

        for p in pset {
            if p > 1 && pex[p] {
                return true;
            }
            pex[p] = true;
        }
        false
    }) {
        Coprime::Pairwise
    } else {
        let iter = ar.into_iter();
        let tmp = iter.fold(0, |acc, &x| gcd(acc, x));
        if tmp == 1 {
            Coprime::Setwise
        } else {
            Coprime::Not
        }
    }
}

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