use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();
    let a: Vec<usize> = (0..n).map(|_| iterator.next().unwrap().parse().unwrap()).collect();

    let mut counts: Vec<usize> = vec![0; 1_000_005];
    for i in 0..n {
        count_divisors(a[i], &mut counts);
    }

    let mut is_coprime = true;
    for i in 2..1_000_005 {
        if counts[i] > 1 {
            is_coprime = false;
            break;
        }
    }
    if is_coprime {
        return "pairwise coprime".to_string();
    }

    let mut g = a[0];
    for i in 1..n {
        g = gcd(g, a[i]);
    }

    if g == 1 {
        "setwise coprime".to_string()
    } else {
        "not coprime".to_string()
    }
}

fn count_divisors(n: usize, counts: &mut Vec<usize>) {
    let mut i = 1;
    while i * i <= n {
        if n % i == 0 {
            counts[i] += 1;
            if n / i != i {
                counts[i] += 1;
            }
        }
        i += 1;
    }
}

fn gcd(mut x: usize, mut y: usize) -> usize {
    while y > 0 {
        let r = x % y;
        x = y;
        y = r;
    }
    return x;
}
