#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline int read()
{
	int x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

bool is[maxn];
int pri[maxn],cnt,a[maxn],n,c[maxn],pos[maxn];

inline void pre()
{
	for(int i=2;i<=maxn-5;i++)
	{
		if(!is[i]) pri[++cnt]=i;
		for(int j=1;j<=cnt;j++)
		{
			int k=pri[j]*i; if(k>maxn-5) break; is[k]=1;
			if(i%pri[j]==0) break;
		}
	}
}


int main()
{
	pre(); n=read(); int F=0;
	rep(i,1,cnt) pos[pri[i]]=i;
	rep(i,1,n) a[i]=read();
	rep(i,1,n)
	{
		int p=a[i];
		rep(j,1,cnt)
		{
			if(pri[j]*pri[j]>p) break;
			if(p%pri[j]==0)
			{
				if(c[j]) {F=1; break;}
				c[j]++; while(p%pri[j]==0) p/=pri[j];
			}
		}
		c[pos[p]]++;
		if(F) break;
	}
	if(!F) return puts("pairwise coprime"),0;
	int tmp=a[1];
	rep(i,2,n) tmp=__gcd(tmp,a[i]);
	if(tmp==1) puts("setwise coprime");
	else puts("not coprime");
	return 0;
}