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

#define MAXN 1000000

int n;
int a[1000005];
bool isPrime[100005];
vector <int> primes;
bool isUsed[1000005];

int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) scanf("%d", &a[i]);
	for (int i = 2; i <= MAXN; i++) isPrime[i] = true;
	for (int i = 2; i * i <= MAXN; i++) {
		if (isPrime[i]) {
			for (int j = i * i; j <= MAXN; j++) isPrime[j] = false;
		}
	}
	for (int i = 2; i <= MAXN; i++) if (isPrime[i])
		primes.push_back(i);
	bool coprime = true;
	for (int i = n - 1; i >= 0; i--) {
		int temp = a[i];
		for (int prime : primes) {
			if (prime * prime > temp) break;
			if (temp % prime == 0) {
				if (isUsed[prime]) {
					coprime = false;
					break;
				}
				isUsed[prime] = true;
			}
			while (temp % prime == 0) {
				temp /= prime;
			}
		}
		if (!coprime && temp != 1) {
			if (isUsed[temp]) coprime = false;
			else isUsed[temp] = true;
		}
		if (!coprime) break;
	}
	if (coprime) {
		printf("pairwise coprime\n");
		return 0;
	}

	int curgcd = a[0];
	for (int i = 1; i < n; i++) {
		curgcd = __gcd(curgcd, a[i]);
	}
	if (curgcd == 1) printf("setwise coprime\n");
	else printf("not coprime\n");
	return 0;
}
