#include <bits/stdc++.h>
#define N int(1e6+10)
#define fi first
#define si second
using namespace std; 
int spf[N];
map<int,int>m,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() 
{ 
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	sieve();
	int n;
	cin>>n;
	int a[n],g=0;
	for(int i=0;i<n;i++)
		cin>>a[i];
	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[spf[x]]++;
			x/=spf[x];
		}
		for(auto it:cm)
			if(it.si<m[it.fi]){
				first=false;
			}
	}
	if(first){
		cout<<"pairwise coprime\n";
	}else if(g==1){
		cout<<"setwise coprime\n";
	}else
		cout<<"not coprime\n";
	return 0;
} 