#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
vector<int> pr;
bool prime[1000000+1]; 
int arr[1000000];
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. 

    
  
    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; 
        } 
    } 
  
} 

int main()
{
	memset(prime, true, sizeof(prime)); 
	SieveOfEratosthenes(1000000);
	
	int n;
	string answer;
	bool ans = true;
	cin >> n;
	int i,j;
	int gc = 0;
	unordered_set<int> st;
	for(i=0;i<n;i++)
	{
		cin >> arr[i];
		gc = __gcd(gc,arr[i]);
	}
	for(j=n-1;j>=0;j--)
	{
		int qr= sqrt(arr[j]);
		for(i=2;i<=qr;i++)
		{
			if(arr[j]%i == 0)
			{
				int f = i;
				int s = n/i;
				if(prime[f] == 1)
				{
					if(st.find(f)==st.end())
						st.insert(f);
					else ans = false;
				}
				else if(prime[s]==1)
				{
					if(st.find(s)==st.end())
						st.insert(s);
					else ans = false;
				}
			}
		}
	}
	if(ans == true)
	 answer = "pairwise coprime\n";
	else if(gc ==1)
		answer = "setwise coprime\n";
	else
		answer = "not coprime\n";
	cout<<answer;
}
