use proconio::input;

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

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

	let mut max = 0;
	for &x in &a {
		if max < x { max = x };
	}

	let max = max as usize;

	let mut spf = vec![0; max+1];
	spf[1] = 1;
	for i in 2..max {
		spf[i] = i;
	}

	for i in (4..max).step_by(2) {
		spf[i] = 2;
	}

	let mut j = 3;
	while j*j < max {
		if spf[j] == j {
			let mut k = j*j;
			while k < max {
				if spf[k] == k {
					spf[k] = j;
				}
				k += j;
			}
		}
		j += 1;
	}

	let mut ga = 0usize;
	let mut aw = true;

	let mut factors = vec![false; max+1];

	for &x in &a {
		if aw {
			let mut y = x;
			while y != 1 {
				let f = spf[y];
				if !factors[f] {
					factors[f] = true;
				} else {
					aw = false;
				}
				y /= f;
			}
		}
		ga = gcd(x, ga);
	}

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