;エラトステネスの篩
(defun sieve (N)
  (if (<= N 1) nil
      (loop with lst = (cons 2 (loop for x from 3 to N by 2 collect x))
            and max = (isqrt N) and p1
            initially (setf p1 lst) 
            if (or (null (cdr p1)) (< max (car p1))) return lst
            do (loop with p2 = p1 while (cdr p2) 
                     if (zerop (mod (cadr p2) (car p1))) do (rplacd p2 (cddr p2))
                     do (setf p2 (cdr p2)))
            do (setf p1 (cdr p1)))))

(defun solve (N)
  (loop for x in (sieve N)
        with lst = (loop repeat N collect (read))
        if (< 1 (loop for y in lst count (zerop (mod y x))))
        return (if (= 1 (apply #'gcd lst)) "setwise coprime" "not coprime")
        finally (return "pairwise coprime")))

(princ (solve (read)))