import sys
from math import sqrt, gcd, ceil, log, floor
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
input = sys.stdin.readline
read = lambda: list(map(int, input().strip().split()))

# MOD = 10**9 + 7
def main():
	MAXN = 1000001
	spf = [0 for i in range(MAXN)] 
	sett = set()
	def sieve(): 
		spf[1] = 1
		for i in range(2, MAXN):  
			spf[i] = i 

		for i in range(4, MAXN, 2): 
			spf[i] = 2

		for i in range(3, ceil(sqrt(MAXN))): 
			
			if (spf[i] == i): 
				
				for j in range(i * i, MAXN, i): 
					
					if (spf[j] == j): 
						spf[j] = i
	sieve()
	
	# def getFactorization(x): 
	# 	ret = set() 
	# 	# print("This is for ",x)
	# 	flag = 1
	# 	while (x != 1):
	# 		# print("\t", x, spf[x], sett)
	# 		if spf[x] in sett:
	# 			flag = 0
	# 		ret.add(spf[x]) 
	# 		x = x // spf[x]
	# 	sett = sett.union(ret)
	# 	return flag


	n = int(input()); arr = read()
	gcd_ = arr[0]
	f1 = 0; f2 = 1
	for i in arr:
		gcd_ = gcd(gcd_, i)
		# res = getFactorization(i)
		x = i
		ret = set() 
		# print("This is for ",x)
		flag = 1
		while (i != 1):
			# print("\t", i, spf[x], sett)
			if spf[i] in sett:
				flag = 0
			ret.add(spf[i]) 
			i = i // spf[i]
		sett = sett.union(ret)
		# print(x, flag)
		f1 += flag; f2 &= flag

	# print(sett)

	if f2:print("pairwise coprime")
	elif gcd_ == 1:print("setwise coprime")
	else:print("not coprime")



	



if __name__ == "__main__":
	main()

# import math as mt 




# # def getFactorization(x): 
# # 	ret = list() 
# # 	while (x != 1): 
# # 		ret.append(spf[x]) 
# # 		x = x // spf[x] 

# # 	return ret 
# sieve()
# # print(spf[:100])
