use proconio::input;

fn gcd(mut a: u64, mut b: u64) -> u64 {
	if a > b {
		let c = a;
		a = b;
		b = c;
	}
	while a != 0 {
		b -= a;
		if a > b {
			let c = a;
			a = b;
			b = c;
		}
	}
	b
}

fn lcm(a: u64, b: u64) -> u64 {
	a * b / gcd(a, b)
}

fn main() {
	input! {
		n: usize,
		a: [u64; n],
	}

	let modulo = 10000019;

	let mut la = 1;
	let mut ga = 0;
	let mut ma = 1;

	for x in a {
		la = lcm(la, x) % modulo;
		ga = gcd(ga, x) % modulo;
		ma = ma * x % modulo;
	}

	if la == ma {
		println!("pairwise coprime");
	} else if ga == 1 {
		println!("setwise coprime");
	} else {
		println!("not coprime");
	}
}