#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000


struct unionfind{
	vector<int> data;
	vector<int> size;
	unionfind(int n){
		for(int i=0;i<n;i++){
			data.push_back(i);
			size.push_back(1);
		}
	}
	
	int find(int x){
		if(data[x]==x)return x;
		return data[x]=find(data[x]);
	}
	
	bool unite(int x,int y){
		x=find(x);y=find(y);
		if(x==y)return false;
		if(size[x]>size[y])swap(x,y);
		data[x]=y;
		size[y]+=size[x];
		return true;
	}
	
	bool check(int x,int y){
		return (find(x)==find(y));
	}
	
	int get_size(int x){
		int X = find(x);
		return size[X];
	}
};


int main(){
	
	int N;
	cin>>N;
	unionfind uf(1000005);
	vector<int> A(N);
	bool f = true;
	for(int i=0;i<N;i++){
		scanf("%d",&A[i]);
		if(uf.check(0,A[i])){
			f=false;
		}
		uf.unite(0,A[i]);
	}
	
	if(f){
		for(int i=2;i<=1000000;i++){
			int cnt = 0;
			for(int j=i;j<=1000000;j+=i){
				if(uf.check(0,j))cnt++;
			}
			if(cnt>1){
				f=false;
				break;
			}
		}
		
		if(f){
			cout<<"pairwise coprime"<<endl;
			return 0;
		}
	}
	
	int g = A[0];
	for(int i=0;i<N;i++){
		g = gcd(g,A[i]);
	}
	
	if(g==1)cout<<"setwise coprime"<<endl;
	else cout<<"not coprime"<<endl;
	
	return 0;
}
