let rec gcd n m =
  if m = 0 then n
  else gcd m (n mod m)

let () = Scanf.scanf "%d\n" @@ fun n ->
  let as_ = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun a -> a in
  print_endline @@
  if Array.fold_left gcd 0 as_ <> 1
  then "not coprime"
  else if
    let b = ref true in
    let as__ = Array.make 1000001 0 in
    let prim = Array.make 1000001 true in
    Array.iter (fun a -> as__.(a) <- 1 + as__.(a)) as_;
    for p = 2 to 1000000 do
      if prim.(p) then begin
        let rec iter acc i =
          if 1000000 < i
          then acc
          else (prim.(i) <- false; iter (acc + as__.(i)) (i + p)) in
        b := !b && iter 0 p <= 1
      end
    done;
    not !b
  then "setwise coprime"
  else "pairwise coprime"
