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

bool IsPrime( int num )
{
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false;
	for ( int i = 3; i * i <= num; i += 2 ) {
		if (num % i == 0) return false;
	}
	return true;
}

int main()
{
	int N;
	cin >> N;
	vector<int> A( N );
	for( int i = 0; i < N; i++ ) {
		cin >> A[i];
	}

	string ans = "not coprime";
	vector<int> acc( N + 1 );
	int a = __gcd( A[0], A[1] );
	for( int i = 2; i < N; i++ ) {
		a = __gcd( a, A[i] );
	}
	if( a == 1 ) ans = "setwise coprime";
	int flag = 0;
	for( int i = 0; i < N; i++ ) {
		if( IsPrime( A[i] ) == false ) {
			if( i - 1 >= 0 && __gcd( A[i - 1], A[i] ) != 1 ) {
				flag = 1;
				break;
			}
			if( i + 1 < N && __gcd( A[i], A[i + 1] ) != 1 ) {
				flag = 1;
				break;
			}
		}
	}
	if( flag == 0 ) ans = "pairwise coprime";

	cout << ans << endl;
}
