#include <bits/stdc++.h>
#define N int(1e6+10)
#define fi first
#define si second
#define pb push_back
using namespace std; 
int spf[N];
int m[N];
vector<int>cm;
void sieve() 
{ 
	spf[1] = 1; 
	for (int i=2; i<N; i++) 
		spf[i] = i; 
		
	for (int i=4; i<N; i+=2) 
		spf[i] = 2; 

	for (int i=3; i*i<N; i++) 
	{ 
		if (spf[i] == i) 
		{ 
			for (int j=i*i; j<N; j+=i) 
				if (spf[j]==j) 
					spf[j] = i; 
		} 
	} 
} 

int main() 
{
	int n;
	cin>>n;
	int a[n],g=0;
	for(int i=0;i<n;i++)
		scanf("%d",&a[i]);
	sieve();
	for(int i=0,x;i<n;i++){
		x=a[i];
		g=__gcd(g,a[i]);
		while(x>1){
			m[spf[x]]++;
			x/=spf[x];
		}
	}
	bool first=true;
	for(int i=0,x;i<n&&first;i++){
		x=a[i];
		while(x>1){
			cm.pb(spf[x]);
			x/=spf[x];
			m[spf[x]]--;
		}
		for(int i=0;i<cm.size();i++)
			if(m[cm[i]]){
				first=false;
			}
		for(int i=0;i<cm.size();i++)
			m[cm[i]]++;
		cm.clear();
	}
	if(first){
		printf("pairwise coprime\n");
	}else if(g==1){
		printf("setwise coprime\n");
	}else
		printf("not coprime\n");
	return 0;
} 