unittest
{
	assert( [ "3", "3 4 5" ].solve == "pairwise coprime" );
	assert( [ "3", "6 10 15" ].solve == "setwise coprime" );
	assert( [ "3", "6 10 16" ].solve == "not coprime" );
}



import std.algorithm;
import std.conv;
import std.format;
import std.numeric;
import std.range;
import std.stdio;

void main()
{
	stdin.byLineCopy.solve.writeln;
}

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	input.popFront;
	auto as = input.front.split.to!( long[] );
	
	auto ps = ( 10 ^^ 3 ).primes;
	auto fs = new bool[ 1 + 10 ^^ 6 ];
	auto u = true;
	auto c = as.front;
	foreach( a; as )
	{
		auto uu = true;
		foreach( g; a.primefactorize( ps ).group )
		{
			if( fs[ g[ 0 ] ] ) uu = false;
			else               fs[ g[ 0 ] ] = true;
		}
		if( !uu ) u = false;
		c = gcd( c, a );
	}
	
	if(      u      ) return "pairwise coprime";
	else if( c == 1 ) return "setwise coprime";
	else              return "not coprime";
}

// 素数列
auto primes( long x )
{
	Appender!( long[] ) ps;
	if( x < 2 ) return ps.data;
	
	auto cs = new bool[]( x + 1 );
	ps ~= 2L;
	for( auto i = 3L; i * i < cs.length; i += 2 )
	{
		if( cs[ i ] ) continue;
		for( auto j = i; i * j < cs.length; j++ )
		{
			cs[ i * j ] = true;
		}
	}
	for( auto i = 3L; i < cs.length; i += 2 )
	{
		if( !cs[ i ] ) ps ~= i;
	}
	return ps.data;
}

// 素因数分解
auto primefactorize( long x, long[] ps )
{
	Appender!( long[] ) fs;
	if( x < 2 ) return fs.data;
	
	auto s = cast( long ) x ^^ 0.5L;
	foreach( p; ps )
	{
		if( s < p ) break;
		while( x % p == 0 )
		{
			x /= p;
			fs ~= p;
		}
		if( x < 2 ) break;
	}
	if( 2 <= x ) fs ~= x;
	return fs.data;
}
