#include <bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef long long ll;

int mxn = 1e6 + 4;
vector<int> primes;

void sieve()
{
	vector<bool> isPrime(mxn+1, true);
	for (int i=2; i*i<=mxn; i++) {
		if (!isPrime[i]) continue;
		for (int j=i*i; j<=mxn; j+=i) {
			isPrime[j] = false;
		}
	}
	for (int i=2; i<=mxn; i++) {
		if (isPrime[i]) primes.push_back(i);
	}
}

bool isPairwiseCoprime(vector<int>& a)
{
	for (int p : primes) {
		int cnt = 0;
		for (int x : a) {
			cnt += (x % p == 0);
		}
		if (cnt > 1) return false;
	}
	return true;
}

bool isSetwiseCoprime(vector<int>& a, int n)
{
	int gcd = a[0];
	for (int i=1; i<n; i++) {
		gcd = __gcd(gcd, a[i]);
	}
	return gcd == 1;
}

int main()
{
	fastIO;
	sieve();	
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i=0; i<n; i++)
		cin >> a[i];

	if (isPairwiseCoprime(a)) {
		cout << "pairwise coprime\n";
	}
	else if (isSetwiseCoprime(a, n)) {
		cout << "setwise coprime\n";
	}
	else {
		cout << "not coprime\n";
	}
}