#include <bits/stdc++.h>
#include<cmath>
using namespace std;
#define int unsigned long long 
#define mod 1000000007
const int sz = 1000000;
bool pr[sz];
void sieve()
{
    memset(pr,true,sizeof(pr));
    
    for(int p = 2;p*p<sz;p++)
    {
        if(pr[p])
        {
            for(int i = p*p;i<sz;i+=p)
            pr[i] = false;
        }
    }
    pr[0] = pr[1] = false;
    
}
signed main() {
    
    sieve();
    
    int n;
    cin>>n;
    int arr[n];
    vector<int> temp;
    for(int i = 0;i<n;i++){
    cin>>arr[i];
    if(arr[i]!=1)
    temp.push_back(arr[i]);
    }
    
    if(temp.size() == 0)
    {
        cout<<"pairwise coprime"<<"\n";
    }
    else{
    int gcd1 = temp[0];
    
    for(int i = 1;i<temp.size();i++)
    gcd1 = __gcd(gcd1 , temp[i]);
    
    std::vector<int> prime;
    // store all the prime numbers form the given array.
   
    
    int val = 0;
    for(int i = 0;i<n;i++)
    {
        if(pr[temp[i]]){
        prime.push_back(temp[i]);
        
        }
        else
        val = temp[i];
    }
    
    if(prime.size() == temp.size()) 
    cout<<"pairwise coprime"<<"\n";
    else if(prime.size() == temp.size() - 1)
    {
        // we have res ..
        bool flag = false;
        for(int i = 0;i<prime.size();i++)
        {
            if(val%prime[i] == 0)
            {
                flag = true;
                break;
            }
        }
        if(!flag)
        cout<<"pairwise coprime"<<"\n";
        else if(gcd1 == 1)
        cout<<"setwise coprime"<<"\n";
        else
        cout<<"not coprime"<<"\n";
    }
    else if(gcd1 == 1)
    cout<<"setwise coprime"<<"\n";
    else
    cout<<"not coprime"<<"\n";
    
    }
    
    
 
}