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

#define V vector
typedef long long ll;
typedef unsigned long long ull;

typedef V<int> vi;
typedef V<ll> vll;
typedef V<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define f(i,a) for(int i = 0 ; i < a ; i++)
#define fll(i,a) for(ll i = 0 ; i < a ;i++)
#define forab(i,a,b) for(int i = a ; i < b ; i++)
#define prec(x) cout<<fixed<<setprecision(x)
#define ff first
#define ss second

#define pb push_back
//#define mp make_pair
#define numberofdigits(x) floor(log10(x)) + 1

const ll mod = 1e9 + 7;

ll binpow(ll a, long long b) {
	ll res = 1;
	while (b > 0) {
		if (b & 1)
			res = (res * a);
		a = (a * a);
		b >>= 1;
	}
	return res;
}

vector<vector<int>> a;
vector<int> vis;

int dfs(int node) {
	vis[node] = 1;
	int ans = 1;
	for (auto child : a[node]) {
		if (vis[child] == 1) continue;

		ans += dfs(child);
	}
	return ans;
}
V<bool> isPrime(2000001);
vi prime;
void init() {

	isPrime.assign(2000001 , true);
	isPrime[0] = isPrime[1] = false;
	for (int i = 2 ; i * i <= 2000000 ; i++)
	{
		if (isPrime[i])
		{
			for (int j = i * i ; j <= 2000000 ; j += i)
				isPrime[j] = false;
		}
	}

	for (int i = 2 ; i <= 2000000 ; i++)
	{
		if (isPrime[i])
			prime.pb(i);
	}
}

void solve() {

	int n;
	cin >> n;

	int a[n];

	map<int , int> mp;

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

		if (i != 0)
		{
			int x = a[i];

			for (ll j = 2 ; j * j <= x ; j++)
			{
				int cnt = 0;

				while (x % j == 0)
					x /= j , cnt++;
				mp[j]++;
			}

			if (x > 1)
				mp[x]++;
		}
	}

	int g = a[0];
	bool setwise = false , pairwise = false;

	if (g == 1) setwise = true;
	for (int i = 1 ; i < n ; i++)
		g = __gcd(g , a[i]);

	for (int i = 0; i < n ; i++) {

		int x = a[i];

		bool ok = true;

		for (int p = 2 ; p * p <= x ; p++)
		{

			if (x % p == 0) {
				if (mp[p] > 1)
				{
					ok = false;
					break;
				}
				else
					mp[p]--;

				while (x % p == 0)
					x /= p;
			}
		}

		if (ok)
		{
			pairwise = true;
			break;
		}
	}

	if (pairwise)
		cout << "pairwise coprime\n";
	else if (setwise)
		cout << "setwise coprime\n";
	else cout << "not coprime\n";
}

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	init();
	int t = 1;
	//cin >> t;

	while (t--)
		solve();
	return 0;
}



