#include <bits/stdc++.h>
using namespace std;

const int MAX_N = 1e6;

void optimizeIO() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}

int main() {
	int N, A[MAX_N + 1], gcdOfAll;
	set<int> primes;
	bool setwise = false, pairwise = false;
	optimizeIO();
	cin >> N >> A[1];
	gcdOfAll = A[1];
	for (int i = 2; i <= N; ++i) {
		cin >> A[i];
		gcdOfAll = gcd(gcdOfAll, A[i]);
	}
	if (gcdOfAll == 1) {
		setwise = true;
		pairwise = true;
		for (int i = 1; i <= N and pairwise; ++i) {
			int original = A[i];
			for (int divisor = 2; divisor * divisor <= original; ++divisor) {
				if (A[i] % divisor == 0) {
					while (A[i] % divisor == 0)
						A[i] /= divisor;
					auto result = primes.insert(divisor);
					if (result.second == false) {
						pairwise = false;
						break;
					}
				}
			}
		}
	}
	if (pairwise)
		cout << "pairwise coprime" << endl;
	else if (setwise)
		cout << "setwise coprime" << endl;
	else
		cout << "not coprime" << endl;
	return 0;
}
