#include<bits/stdc++.h>
#define MOD 1000000007
#define md 998244353
#define INF LLONG_MAX
#define F first
#define S second
#define sz(x) (long long)x.size()
#define vi vector<int>
#define vll vector<long long>
#define vpl vector<pair<long long,long long> >
#define vpi vector<pair<int,int> >
#define pb push_back
#define debug(x) cerr<<#x<<"= "<<x<<endl
#define all(v) v.begin(),v.end()
#define TT ll test;cin>>test; while(test--)
#define rep(i,a,n) for(ll i=a;i<(long long)n;++i)
#define repr(i,n,a) for(ll i=n;i>(long long)a;--i)
#define endl '\n'
#define MAXN 1000005
typedef long long ll;
typedef long double ld;
using namespace std;
#define int long long
int spf[MAXN]; 
  
// Hash to store prime factors count 
int hash1[MAXN] = { 0 }; 
  
// 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 
void getFactorization(int x) 
{ 
    int temp; 
    while (x != 1) { 
        temp = spf[x]; 
        if (x % temp == 0) { 
  
            // Storing the count of 
            // prime factors in hash 
            hash1[spf[x]]++; 
            x = x / spf[x]; 
        } 
        while (x % temp == 0) 
            x = x / temp; 
    } 
} 
  
// Function that returns true if there are 
// no common prime factors between x 
// and other numbers of the array 
bool check(int x) 
{ 
    int temp; 
    while (x != 1) { 
        temp = spf[x]; 
  
        // Checking whether it common 
        // prime factor with other numbers 
        if (x % temp == 0 && hash1[temp] > 1) 
            return false; 
        while (x % temp == 0) 
            x = x / temp; 
    } 
    return true; 
} 
  
// 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++) 
        getFactorization(arr[i]); 
  
    // Checking the common prime factors 
    // with other numbers 
    for (int i = 0; i < n; i++) 
        if (check(arr[i])) 
            return true; 
  
    return false; 
} 
signed main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    int cnt=0;
    for (int i = 0; i < n; ++i)
    {
    	cin>>a[i];if(a[i]==1)++cnt;
    }
    if(cnt>=n-1){
    	cout<<"pairwise coprime";
    	return 0;
	}
	int m=n-cnt;
	int b[m];
	int pos=0;
	for(int i=0;i<n;i++){
		if(a[i]!=1){
			b[pos++]=a[i];
		}
	}
    if(hasValidNum(b,m)){
    	cout<<"pairwise coprime";
    }else{
    	int g=a[0];
    	for (int i = 0; i < n; ++i)
    	{
    		g=__gcd(a[i],g);
    	}
    	if(g==1){
    		cout<<"setwise coprime";
    	}else{
    		cout<<"not coprime";
    	}
    }

    return 0;
}