parseInt(x)=parse(Int, x)
parseMap(x::Array{SubString{String},1})=map(parseInt, x)

function main()
	n = readline() |> parseInt
	b = readline() |> split |> parseMap
	a = copy(b)
	d = Dict{Int,Int}()
	f = 0
	for i in 1:n
		x = 2
		df = 0
		while a[i]>1 && x*x<=a[i]
			if a[i]%x == 0
				if haskey(d,x)&&df==0
					f = 1
				else
					d[x] = 1
				end
				a[i] = x*x==a[i] ? 1 : div(a[i],x)
				df = 1
			else
				x += 1
				df = 0
			end
		end
		if haskey(d,a[i])
			f = 1
		else
			d[a[i]] = 1
		end
	end
	if f == 0
		println("pairwise coprime")
	else
		k = b[1]
		for i in 2:n
			k = gcd(k,b[i])
		end
		println(k==1 ? "setwise coprime" : "not coprime")
	end
end

main()