import std.container;
import std.range;
import std.algorithm;
import std.array;
import std.string;
import std.conv;
import std.stdio;
import std.container;

bool isPairwiseCoprime(const(int)[] a) {
	auto sieve = new int[10 ^^ 6 + 1];
	auto used = new bool[sieve.length];
	foreach (i, ref e;sieve) {
		e = cast(int)i;
	}
	sieve[1] = 0;

	for (int i = 2;i < sieve.length;++i) {
		if (sieve[i] != i) {
			continue;
		}

		for (int j = i + i;j < sieve.length;j += i) {
			sieve[j] = i;
		}
	}

	auto primeList = new int[32];
	foreach (int e;a) {
		primeList.length = 0;

		while (e > 1) {
			primeList ~= sieve[e];
			e = e / sieve[e];
		}

		auto previous = 0;
		foreach (p;primeList) {
			if (previous != p && used[p]) {
				return false;
			} else {
				used[p] = true;
			}
			previous = p;
		}
	}
	return true;
}

bool isSetwiseCoprime(const(int)[] a) {
	int gcd(int a, int b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	return a.reduce!gcd == 1;
}

void main() {
	readln;
	auto a = readln.chomp.split(' ').map!(to!int).array;

	if (isPairwiseCoprime(a)) {
		writeln("pairwise coprime");
		return;
	}

	if (isSetwiseCoprime(a)) {
		writeln("setwise coprime");
		return;
	}

	writeln("not coprime");
}
