#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define F first
#define S second
#define endl "\n"
#define nl cout<<endl
#define pb push_back
#define f(i,a,b) for(ll i=a;i<b;i++)
#define Knucklehead ios_base::sync_with_stdio(false);cin.tie(NULL);
#define txti freopen("input.txt", "r", stdin);
#define txto freopen("output.txt", "w", stdout);
//#define mod 100000007

#define mat vector<vector<ll>>
mat cn(ll n, ll m){return vector< vector<ll> >(n, vector<ll>(m));}
bool compare(char &s1,char &s2){return s1 > s2;} 

bool sortmahstyle(const pair<ll,ll> &a,  const pair<ll,ll> &b) 
{ 
    if(a.second > b.second )
        return true;
    if( a.second==b.second && a.first > b.second )
       return true;
 
    return false;
 }
//me
ll const mod = 1e9+7;//998244353;
ll const inf = 1e6+1;

ll prime[inf];
void sieve(){
    fill(prime,prime+inf,1);
    prime[1]=1;
    for(ll i =2; i*i < inf; i++){

        if(prime[i]==1)
            for(ll j=i; j<inf; j+=i)
                prime[j]=i;

    }
}
void solve()
{   
    ll n; cin >> n;
    ll a[n], primecount=0;
    set<ll> cnt;   
    ll gcdtot;
    f(i,0,n){
        cin >> a[i];
        if(i==0)
            gcdtot = a[i];
        else
            gcdtot = __gcd(gcdtot,a[i]);
    }
    set<ll> universalset;
    f(i,0,n){

        ll N = a[i];
        set<ll> cur_set;
        while(N>1){
            cur_set.insert(prime[N]);
            N = N/prime[N];
        }
        for(auto e : cur_set){
            if(universalset.count(e))
                goto here;
            else
                universalset.insert(e);
        }
    }
    cout << "pairwise coprime\n";
    return;
    here:
    if(gcdtot==1){
        cout << "setwise coprime\n";
    }
    else
        cout << "not coprime\n";

} 

int main() {
Knucklehead 
//*
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
/**/ 
        sieve();
        ll t;
        /**/t=1;
        /*/cin>>t;/**/
        f(testcases,0,t){
            solve();
        }
 
 
    return 0;
}
