#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;

#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
int fac[1000001];

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    int arr[n];
    memset(fac,-1,sizeof fac);
    for(int i=0;i<n;i++){
    	cin >> arr[i];
    }


    fac[0] = 0;
    fac[1] = 0; 
    for(int i = 2;i*i<=(int)1e6;i++){
    	if(fac[i] != -1)
    		continue;
    	fac[i] = i;
    	for(int j = i;j<=(int)1e6;j+=i){
    		if(fac[j] == -1)
    			fac[j] = i;
    	}
    }

    set<int> seen;
    bool yes = true;
	for(int i=0;i<n;i++){
		if(arr[i] == 1) continue;
		if(seen.count(fac[arr[i]])){
			yes = false;
			break;
		}
		else seen.insert(fac[arr[i]]);
	}

    if(yes) {
    	cout<<"pairwise coprime"<<"\n";
    	return 0;
	}

	int ans = arr[0];
	for(int i=1;i<n;i++){
		ans = __gcd(arr[i],ans);
		if(ans == 1) break;
	}

    if(ans == 1) cout<<"setwise coprime"<<"\n";
    else cout<<"not coprime"<<"\n";
    return 0;
}
