{-# LANGUAGE BangPatterns        #-}
{-# LANGUAGE FlexibleContexts    #-}
{-# LANGUAGE RankNTypes          #-}
{-# LANGUAGE ScopedTypeVariables #-}
import           Control.Monad
import           Control.Monad.ST
import           Control.Monad.State
import qualified Data.ByteString.Char8        as BS
import           Data.Char
import qualified Data.Vector.Unboxing         as VU
import qualified Data.Vector.Unboxing.Mutable as VUM

main :: IO ()
main = do
  n <- readLn :: IO Int
  avec <- readLnAsUVecWith unconsInt n
  let setwise = VU.foldl1' gcd avec

  putStrLn $ if VU.null $ VU.filter (>1) $ solve (sieve (10^6+5)) avec
             then "pairwise coprime"
             else if setwise == 1 then "setwise coprime" else "not coprime"

solve :: VU.Vector Int -> VU.Vector Int -> VU.Vector Int
solve sieveVec avec = VU.create $ do
  counts <- VUM.replicate (10^6+5) 0
  VU.forM_ avec $ \a -> go a a counts

  return counts

  where go :: Int -> Int -> VUM.MVector s Int ->  ST s ()
        go _ 1 _ = return ()
        go i a counts = do let s = sieveVec VU.! a
                           if s == i then go i (a`div`s) counts
                             else do c <- VUM.read counts s
                                     VUM.write counts s (c+1)
                                     go s (a`div`s) counts

-- 添字の数字の最初の素因数を格納した配列を作る(Eratosthenesの篩)
-- もし添字の数字と格納されている数が等しければ、素数
sieve :: Int -> VU.Vector Int
sieve n = VU.create $ do
  vec <- VUM.replicate (n+1) 0
  VUM.write vec 1 1
  forM_ [2..n] $ \i -> do
    b <- VUM.read vec i
    when (b == 0) $ do
      VUM.write vec i i
      forM_ [2*i,3*i..n] $ \j -> VUM.write vec j i
  return vec


unconsInt :: StateT BS.ByteString Maybe Int
unconsInt = StateT $ BS.readInt . BS.dropWhile isSpace

readLnAsUVecWith :: VU.Unboxable a => StateT BS.ByteString Maybe a -> Int -> IO (VU.Vector a)
readLnAsUVecWith !st !n = VU.unfoldrN n (runStateT st) <$> BS.getLine
