#include<cstdio>
#include<set>
#include<numeric>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const static int MAX_N = 1000000;
bool is_prime[MAX_N+1];

int main(){
    set<unsigned> prime_list = {2};
	is_prime[2] = true;
    unsigned i;
	for (i = 3; i <= MAX_N; i += 2) is_prime[i] = true;
	for (i = 3; i*i <= MAX_N; i += 2){
		if(is_prime[i]){
            prime_list.insert(i);
			for (unsigned j = i*i; j <= MAX_N; j += i << 1) is_prime[j] = false;
		}
	}
    for(;i <= MAX_N; i += 2){
        if(is_prime[i]){
            prime_list.insert(i);
        }
    }
    unsigned N, a1, a2, tmp;
    scanf("%u\n%u %u", &N, &a1, &a2);
    for(auto k : prime_list) if(a1 % k) prime_list.erase(k);
    for(auto k : prime_list) if(a2 % k) prime_list.erase(k);
    unsigned setwise = std::gcd(a1, a2);
    for(unsigned i = 2; i < N; i++){
        scanf("%u", &tmp);
        for(auto j : prime_list) if(tmp % j) prime_list.erase(i);
        setwise = gcd(setwise, tmp);
    }
    if(prime_list.empty()){
        printf("pairwise coprime\n");
        return 0;
    }
    if(setwise > 1){
        printf("setwise coprime\n");
        return 0;
    }
    printf("not coprime\n");
	return 0;
}