import numpy as np


n = int(input())
arr = np.array(list(map(int, input().split())))


cnt = np.bincount(arr)


ans1 = np.all([cnt[i::i].sum() <= 1 for i in range(2, 1000)])
ans2 = np.gcd.reduce(arr) == 1

if ans1 and ans2:
    print("pairwise coprime")
elif ans2:
    print("setwise coprime")
else:
    print("not coprime")