//The Doc

#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
typedef long long int ll;
typedef unsigned long long int ull;
#define fi first
#define se second
#define pb push_back
ll mod1=pow(10,9)+7;
int mod2=998244353;
ll inf=1e9;
ll maxxy=1e6+9;
typedef long double ld;
const double PI =  3.141592653589793238;

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

ll modInverse(ll n, ll pp)
{
    return power(n, pp-2, pp);
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    vector<ll> a(n);
    ll x=1;
    for (int i = 0; i <n ; ++i) {
        cin>>a[i];
        if(i==0){
            x=a[i];
        }
        else{
            x=__gcd(x,a[i]);
        }
    }
    cout<<x<<"\n";
    if(x!=1){
        cout<<"not coprime"<<"\n";
    }
    else{
        vector<ll> minPrime(1e6 + 1,0);
        for (int i = 2; i * i <= 1e6; ++i) {
            if (minPrime[i] == 0) {
                for (int j = i * i; j <= 1e6; j += i) {
                    if (minPrime[j] == 0) {
                        minPrime[j] = i;
                    }
                }
            }
        }
        for (int i = 2; i <= n; ++i) {
            if (minPrime[i] == 0) {
                minPrime[i] = i;
            }
        }
        vector<ll> ct(1e6+1,0);
        for (int i = 0; i <n ; ++i) {
            set<ll> sett;
            while(a[i]!=1){
                sett.insert(minPrime[a[i]]);
                a[i] /= minPrime[a[i]];
            }
            set<ll> ::iterator itr;
            for (itr = sett.begin(); itr != sett.end(); ++itr)
            {
                ll kkk=*itr;
                ct[kkk]++;
            }
            sett.clear();
        }
        sort(ct.begin(),ct.end());
        if(ct[n]>=1){
            cout<<"pairwise coprime"<<"\n";
        }
        else{
            cout<<"setwise coprime"<<"\n";
        }
    }
    return 0;
}
