#include<bits/stdc++.h>
using namespace std;

#define sync {ios_base ::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}
#define ll long long int
#define mod 1000000007

set<int> factors;

int n;

void solve()
{
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    
    bool coprime=true;
    
    for(int i=n-1;i>=0;i--)
    {
        for(int j=1;j*j<=a[i];j++)
        {
            if(a[i]%j==0)
            {
                if(j!=1)
                {
                    if(factors.find(j)!=factors.end())
                    {
                        coprime=false;
                        break;
                    }
                    factors.insert(j);
                }
                int k = a[i]/j;
                if(k!=1)
                {
                    if(factors.find(k)!=factors.end())
                    {
                        coprime=false;
                        break;
                    }
                    factors.insert(k);
                }
            }
            
        }
        if(!coprime)
            break;
    }
    
    if(coprime)
    {
        cout<<"pairwise coprime";
        return;
    }
    
    int hcf=a[0];
    
    for(int i=0;i<n;i++)
    {
        hcf = __gcd(hcf,a[i]);
    }
    
    if(hcf==1)
    {
        cout<<"setwise coprime";
        return;
    }
    
    cout<<"not coprime";
    
}

int main()
{
    sync;
    factors.clear();
    int t = 1;
    //cin>>t;
    while(t--){
        solve();
        cout<<"\n";
    }
    return 0;
}





