#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n';

int arr[(int)1e6 + 1];
signed main(){
	memset(arr, -1, sizeof(arr));
	for(int i = 2; i*i<=1e6; ++i){
		if(arr[i]==-1){
			arr[i] = i;
			for(int j = 2*i; j <= 1e6 && arr[j]==-1; j+=i){
				arr[j] = i;
			}
		}
	}
	int n;cin>>n;
	int gc = 0;
	map<int, int> mp;
	for(int i = 0; i < n; ++i){
		int x;cin>>x; if(x==1) continue;
		gc =__gcd(gc, x);
		mp[arr[x]]++;
	}
	bool ok = 1;
	for(auto x : mp) ok &= x.second < 2;
	if(ok){cout<<"pairwise coprime";}
	else if(gc==1){
		cout<<"setwise coprime";
	} else{
		cout<<"not coprime";
	}

	return 0;
}

