#include <bits/stdc++.h>
using namespace std;

#define MAXN 1000005


int spf[MAXN];

// Hash to store prime factors count
map<int,int> hash1;

// Function to calculate SPF (Smallest Prime Factor)
// for every number till MAXN
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;

	// Checking if i is prime
	for (int i = 3; i * i < MAXN; i++) {

		// Marking SPF for all numbers divisible by i
		if (spf[i] == 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;
		}
	}
}

// Function to store the prime factors after dividing
// by the smallest prime factor at every step
bool getFactorization(int x)
{
	int num=x;
	int temp;
	while (x != 1) {
		temp = spf[x];
		if (x % temp == 0) {

			if(hash1.find(spf[x])!=hash1.end()&&hash1[spf[x]]!=num){
                return true;
			}
			hash1[spf[x]]=num;
			x = x / spf[x];
		}
		while (x % temp == 0)
			x = x / temp;
	}
	return false;
}



// Function that returns true if there is
// an element in the array which is coprime
// with all the other elements of the array
bool hasValidNum(int arr[], int n)
{

	// Using sieve for generating prime factors
	sieve();

	for (int i = 0; i < n; i++){
        if(getFactorization(arr[i]))
            return false;
	}
	return true;


}

// Driver code
int main()
{
	hash1.clear();
	ios_base::sync_with_stdio (false) ;cin.tie(NULL);
	int n;cin>>n;
	int arr[n];
	for(int i=0;i<n;i++){
        cin>>arr[i];
	}
	bool ans=hasValidNum(arr,n);
	if(ans){
        cout<<"pairwise coprime";
	}else{
	  int s=arr[0];
	  for(int i=1;i<n;i++){
        s=__gcd(arr[i],s);
	  }
	  if(s==1){
        cout<<"setwise coprime";
	  }else{
	   cout<<"not coprime";
	  }
	}


}