#include <bits/stdc++.h>
#define ll long long

using namespace std;
vector<int> fun (int n) 
{ 
 
    vector<int> arr(n+1,-1); 
    
    for (int p=2; p*p<=n; p++) 
    { 
        
        if (arr[p] == -1) 
        { 
            for (int i=p*p; i<=n; i += p) 
                arr[i] = p; 
                
              
        } 
        
    } 
    
    return arr;
} 
    
int gcd(int a,int b)
{
    if(b==0)return a;
    return gcd(b,a%b);
}

int main() {

    int n;
    cin>>n;
    vector<int> arr(n,0);
    cin>>arr[0];
    int mx=arr[0];
    for(int i=1;i<n;i++)
    {cin>>arr[i]; mx=max(mx,arr[i]);}
    
    vector<int> p=fun(1000000);
    
    unordered_set<int> ov;
    
    bool c=true;
    
    for(int i=n-1;i>=0;i--)
    {
        int a=arr[i];
        unordered_set<int> lv;
        while(a!=-1)
        {
            int pr;
            if(p[a]!=-1)
            pr=p[a];
            else pr=a;
            
            if(a!=pr)a=a/pr;
            else a=-1;
            //cout<<pr<<" ";
            lv.insert(pr);
            if(ov.find(pr)!=ov.end()){c=false; break;}
        }
        if(!c)break;
        for(auto it=lv.begin();it!=lv.end();it++)ov.insert((*it));
    }
    
    
    if(c)
    {
        cout<<"pairwise coprime\n";
    }
    else
    {
        c=true;
        int a=arr[0];
        for(int i=1;i<n;i++)
        {
            int b=gcd(a,arr[i]);
            a=b;
            
        }
        if(a==1)
        {
            cout<<"setwise coprime\n";
        }
        else
        cout<<"not coprime\n";
    }
    
    
    return 0;
}