#include<bits/stdc++.h>
#define lld long long
#define pb push_back
#define mk make_pair
#define MAX (lld)1e18+7
#define lim (lld)1e9+7
#define MAX2 (lld)1e6+9
#define ff first
#define ss second
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

const lld mod=lim;

lld power(lld x, lld y, lld p)  
{   lld res = 1;     x = x % p; if (x == 0) return 0;  
  
    while (y > 0)  
    { if (y & 1) res = (res*x) % p;  y = y>>1; x = (x*x) % p;   }  
    return res;  } 


lld extend_gcd(lld a, lld b, lld& x, lld& y) {
    if (b == 0) { x = 1;y = 0;return a;}
    lld x1, y1;
    lld d = extend_gcd(b, a % b, x1, y1);
    x = y1; y = x1 - y1 * (a / b);return d;	}

lld rowNum[]={-1,0,0,1};
lld colNum[]={0,-1,1,0};

std::vector<int> t(4*MAX2);
std::vector<int> v(MAX2);

void build(int p,int tl,int tr)
{
	if(tl==tr)
		t[p] = v[tl];

	else
	{
		int tm=(tl+tr)/2;

		build(2*p,tl,tm);
		build(2*p+1,tm+1,tr);

		t[p] = __gcd(t[2*p],t[2*p+1]);
	}
}

int query(int p,int tl,int tr,int l,int r)
{
	if(l>r)
		return 0;
	else if(tl==l && tr==r)
		return t[p];

	else
	{
		int tm=(tl+tr)/2;

		return __gcd( query(2*p,tl,tm,l,min(r,tm)),
		query(2*p+1,tm+1,tr,max(l,tm+1),r) );
	}
}

int main()
{
	fastio
	int n;
	cin>>n;

	for(int i=0;i<n;i++)
		cin>>v[i];

	build(1,0,n-1);

	int flag=0;
	for(int i=0;i<n-1;i++)
	{
		int isone = query(1,0,n-1,i,n-1);

		if(isone!=1)
		{
			flag=1;
			break;
		}

	}

	if(flag==0)
	{
		cout<<"pairwise coprime"<<endl;
		return 0;
	}

	else
	{
		int isone = query(1,0,n-1,0,n-1);
		if(isone==1)
			cout<<"setwise coprime"<<endl;
		else
			cout<<"not coprime"<<endl;
	}
}