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

const int N = 1e6+3;
int n;
ll a[N],f[N];


vector<ll>primes;
bitset<N>v;
void init() {
    for(ll i=2;i<N;++i) {
        if(!v[i]) {
            primes.push_back(i);
            for(ll j=i+i;j<N;j+=i)
                v[j] = 1;
        }
    }
}

void solve(){
    cin >> n;
    bool flg = 0;
    ll g = 0;
    for(int i=0;i<n;++i) {
        ll t;
        cin >> t;
        a[i] = t;
        g=__gcd(g,a[i]);
        if(!v[a[i]]) {
            if(f[a[i]]>0)
                flg=1;
            f[a[i]]+=1;
        }
        else {
            for(int j=0;j<(int)primes.size()&&primes[j]*primes[j]<=t;++j) {
                if(t%primes[j]==0) {
                    int cnt=0;
                    while(t%primes[j]==0)
                        t/=primes[j] , cnt++;
                    if(f[primes[j]]!=0)
                        flg=1;
                    f[primes[j]]+=cnt;
                }
            }
            if(t>1) {
                if(f[t]>0)
                    flg=1;
                f[t]++;
            }
            
        }
    }
    if(!flg) {
        cout << "pairwise coprime\n";
    }
    else if(g==1) {
        cout << "setwise coprime\n";
    }
    else {
        cout << "not coprime\n";
    }
}

int main(){
    init();
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t=1;
    while(t--)
        solve();
    return  0;
}
