// Sakhiya07 - Yagnik Sakhiya
 
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define ld long double

#define pll pair<ll,ll>
#define ff first
#define ss second

#define pb push_back
#define all(x) x.begin(),x.end()

#define MOD  1000000007
const int N = 1000005; 

#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);srand(time(NULL));
ll spf[N];
void solve()
{
    ll n;
    cin >> n;
    ll a[n];
    ll gcdi=0;
    for(ll i=0;i<n;i++)   cin >> a[i];
    for(ll i=0;i<n;i++)
    {
        gcdi = __gcd(gcdi,a[i]);
    }
    map<ll,ll> primes;
    for(ll i=1;i<N;i++)   spf[i] = i;
    for(ll i=2;i<N;i++)
    {
        if(spf[i]==i)
        {
            for(ll j=i+i;j<N;j+=i)  spf[j] = min(spf[j],i);
        }
    }
    for(ll i=0;i<n;i++)
    {
        ll temp = a[i];
        while(temp>1)
        {
            ll p = spf[temp];
            primes[p]++;
            while(temp%p==0)   
            {
                temp /= p;
            }
        }
    }
    for(ll i=0;i<n;i++)
    {
        ll chk = 1;
        ll temp = a[i];
        while(temp>1)
        {
            ll p = spf[temp];
            if(primes[p]>1)   
            {
                chk = 0;
                break;
            }
            while(temp%p==0)  temp /= p;
        }
        if(chk)
        {
            cout<<"pairwise coprime";
            return;
        }
    }
    if(gcdi==1)  cout<<"setwise coprime";
    else         cout<<"not coprime";
}

int main()
{
    FAST;
    int t = 1;
 // cin >> t;
    for(int i=1;i<=t;i++)
    {
        solve();
    }
}