#include <iostream>
#include <set> 
#include <iterator>
#include <bitset> 
#include <bits/stdc++.h> 
using namespace std;
typedef  long long int ll;
ll mod=1000000007;
#define MAXN   1000001
bool prime[1000001];
void SieveOfEratosthenes(int n) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
     
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
   // for (int p=2; p<=n; p++) 
     //  if (prime[p]) 
       //   cout << p << " "; 
} 

  
// stores smallest prime factor for every number 
int spf[MAXN]; 
  
// Calculating SPF (Smallest Prime Factor) for every 
// number till MAXN. 
// Time Complexity : O(nloglogn) 
void sieve() 
{ 
    spf[1] = 1; 
    for (int i=2; i<MAXN; i++) 
  
        // marking smallest prime factor for every 
        // number to be itself. 
        spf[i] = i; 
  
    // separately marking spf for every even 
    // number as 2 
    for (int i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
  
    for (int i=3; i*i<MAXN; i++) 
    { 
        // checking if i is prime 
        if (spf[i] == i) 
        { 
            // marking SPF for all numbers divisible by i 
            for (int j=i*i; j<MAXN; j+=i) 
  
                // marking spf[j] if it is not  
                // previously marked 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
} 
  
// A O(log n) function returning primefactorization 
// by dividing by smallest prime factor at every step 
void f(int x,int s[]) 
{ 
    set<int> ret; 
    while (x != 1) 
    { 
        if(ret.find(spf[x])==ret.end());
        {   ret.insert(spf[x]);
            //s[spf[x]]++;
        }
        x = x / spf[x]; 
    } 
    for(auto itr=ret.begin();itr!=ret.end();itr++)
        s[*itr]++;
   // return ret; 
}  
int main() {
    int t=1;
    SieveOfEratosthenes(1000000);
    sieve();
    //cin>>t;
    while(t--)
    {   int n;
        cin>>n;
        int a[n];
        for(int i=0;i<n;i++ )
            cin>>a[i];
        int s[MAXN]={0};
        for(int i=0;i<n;i++)
           f(a[i],s);
        int flag1=0;
        int flag2=0;
        //cout<<"JI"<<endl;
        for(int i=1;i<=1000000;i++)
        {    if(prime[i])
            {   if(s[i]==n)
                {   flag1++;
                    break;
                }
                else if(s[i]>1 && s[i]<n)
                {   flag2++;
                }
            }
        }
        //cout<<flag1<<endl;
        //cout<<flag2<<endl;
        //cout<<s[2]<<" "<<s[3]<<" "<<s[5]<<endl;
        if(flag1==0 && flag2==0)
            cout<<"pairwise coprime";
        else if(flag1>0)
            cout<<"not coprime";
        else
            cout<<"setwise coprime";
        
            
            
    }
	return 0;
}


Measured memory_bytes: 16316