def get_d(a):
  list = []
  for i in range(1,a):
    if a%i == 0:
      list.append(i)
  return list

input_N = input()
N = int(input_N)
a_str = input().split()
dict = {}
for a in a_str:
  dict[a]=get_d(int(a))
pair_flag = True
total_d = []
first_flag = True
for i in range(N-1):
  d_list = []
  new_total_d =[]
  for d in dict[a_str[i]]:
    if d in dict[a_str[i+1]]:
      d_list.append(d)
  for d in d_list:
    if d in total_d:
      new_total_d.append(d)
  if first_flag:
      new_total_d = d_list
      first_flag = False
  total_d = new_total_d
  d_list.sort()
  if not d_list == [1]:
    pair_flag = False
if pair_flag == True:
  print('pairwise coprime')
else:
  total_d.sort()
  if total_d == [1]:
    print('setwise coprime')
  else:
    print('not coprime')
