#include <bits/stdc++.h>
#include <math.h>
#define lli long long int
#include <limits.h>
#include <fstream>
#define F first
#define S second
#define PI 3.141592653589793238
#define pb push_back

using namespace std;

//doesn't work for arrays
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

const lli mod=1000000007;

lli gcd(lli a,lli b)
{
    if(a==0)
        return b;
    return gcd(b%a,a);
}

lli binpow(lli x,lli y,lli m)
{
    if (y==0)
        return 1;
    lli p=binpow(x,y/2,m)%m;
    p=(p*p)%m;
    if(y%2)
        return (x*p)%m;
    else
        return p;
}

lli modi(lli a,lli m)
{
    return binpow(a,m-2,m);
}

const int N=1000001;
bool seive[N],pres[N];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli i,j,tt=1;
    //cin>>tt;
    while(tt--)
    {
        lli n,ones=0;
        cin>>n;
        set<lli> s;
        vector<lli> a(n);
        for(i=0;i<n;i++)
        {
            cin>>a[i];
            s.insert(a[i]);
            if(a[i]==1)
                ones++;
            pres[a[i]]=1;
        }
        if((lli)s.size()!=n && (int)(s.size())+ones!=n+1)
        {
            lli temp=a[0];
            for(i=1;i<n;i++)
                temp=gcd(temp,a[i]);
            if(temp==1)
                cout<<"setwise coprime\n";
            else
                cout<<"not coprime\n";
            continue;
        }
        seive[1]=1;
        bool coprime=1;
        for(i=2;i<N;i++)
        {
            if(seive[i]==0)
            {
                int ct=0;
                if(pres[i])
                    ct++;
                for(j=2*i;j<N;j+=i)
                {
                    seive[j]=1;
                    if(pres[j])
                        ct++;
                }
                if(ct>1)
                    coprime=0;
            }
        }
        if(coprime)
        {
            cout<<"pairwise coprime\n";
            continue;
        }
        lli temp=a[0];
        for(i=1;i<n;i++)
        {
            temp=gcd(temp,a[i]);
        }
        if(temp==1)
            cout<<"setwise coprime\n";
        else
            cout<<"not coprime\n";
    }
    return 0;
}


Measured memory_bytes: 59836