#include<bits/stdc++.h>
using namespace std;
#define int         long long
#define ull         unsigned long long
#define ll          long long
#define M           1000000007
#define pb          push_back
#define p_q         priority_queue
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mp          make_pair
#define lb          lower_bound
#define ub          upper_bound
#define F           first
#define S           second
#define rep(i, begin, end) for (int i=begin;i<end;i++)
#define repd(i, begin, end) for (int i=end-1;i>=begin;i--)
#define ini(a,n,b)  for(ll int i=0;i<n;i++) a[i]=0;
#define cset(a)     __builtin_popcountll(a)

#define hell        1000000007
#define re          resize


int powm(int a,int b)
{
	int res=1;
	while(b)
	{
		if(b&1) 
		res=(res*a)%M;
	    a=(a*a)%M;
	    b>>=1;
	}

	return res;
}

int findMMI_fermat(int n,int m)
{
    return powm(n,m-2);
}





signed main(void)
{ios
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);freopen("answer.txt", "w", stdout);
    #endif*/
    

    vi arr(1e6+5,1);
    vi v(1e6+5,0);
    for(int i=2;i<=1e6;i++)
    {
    	if(!v[i])
    	{
    		arr[i]=i;
    		v[i]=1;
    		for(int j=i*i;j<=1e6;j+=i)
    		{
    			arr[j]=i;
    			v[j]=1;
    		}
    	}
    }


    vi vis(1e6+5,0);
    int n;
    cin>>n;
    vi a(n);

    rep(i,0,n) cin>>a[i];
    int f=1;
    int g=a[0];
    rep(i,1,n) g=gcd(g,a[i]);

    rep(i,0,n)
    {
    	int num=a[i];
    	set<int> s;
    	while(num>1)
    	{ 
            //cout<<num<<' '<<arr[num]<<"   ";
            s.insert(arr[num]);
    		if(vis[arr[num]]) {f=0;}
    		num/=arr[num];

    		
    	}

    	for(auto j:s)
    	{
    		vis[j]=1;
    	}

    	if(!f) break;


    }


    if(f) cout<<"pairwise coprime"<<endl;
    else if(g==1) cout<<"setwise coprime"<<endl;
    else cout<<"neither"<<endl;
    




}