#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;

int gcd(int a, int b){return b ? gcd(b, a%b) : a;}



std::vector<int> Eratosthenes( const int N )
{
    std::vector<bool> is_prime( N + 1 );
    for( int i = 0; i <= N; i++ )
    {
        is_prime[ i ] = true;
    }
    std::vector<int> P;
    for( int i = 2; i <= N; i++ )
    {
        if( is_prime[ i ] )
        {
            for( int j = 2 * i; j <= N; j += i )
            {
                is_prime[ j ] = false;
            }
            P.emplace_back( i );
        }
    }
    return P;
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin>>n;
    vector<int>a(n);
    for (int i = 0; i < n; i++)
    {
        cin>>a[i];
    }
    vector<int>sosu;
    for( const auto &x: Eratosthenes( 1e6+1 ) )
    {
        //cout << x << " ";
        sosu.push_back(x);
    }
    vector<int>b(1e6+1,0);
    for (int i = 0; i < n; i++)
    {
        int x=a[i];
        int c=0;
        while(sosu[c]*sosu[c]<=x){
            if(x%sosu[c]==0){
                b[sosu[c]]++;
                x/=sosu[c];
            }
            else c++;
        }
        if(x!=1) b[x]++;
    }
   // show(b);
    bool ok=true;
    for (int i = 0; i < n; i++)
    {
        int x=a[i];
        int c=0;
        map<int,int>mp;
        while(sosu[c]*sosu[c]<=x){
            if(x%sosu[c]==0){
                b[sosu[c]]--;
                x/=sosu[c];
                mp[sosu[c]]++;
            }
            else c++;
        }
        if(x!=1) b[x]--;
        if(b[x]!=0) ok=false;
        for(auto &u :mp){
            int y=u.first;
            if(b[y]!=0) ok=false;
        }

        //show(b);
        //cerr<<ok<<endl;
    }
    
    int g=a[0];
    for (int i = 0; i < n; i++)
    {
        g=gcd(g,a[i]);
    }
    if(ok){
        cout<<"pairwise coprime"<<endl;
    }
    else if(g==1){
        cout<<"setwise coprime"<<endl;
    }
    else cout<<"not coprime"<<endl;
    
    return 0;
}

Measured memory_bytes: 19672