import           Control.Monad
import           Control.Monad.ST
import           Data.Array
import           Data.Array.ST
import qualified Data.ByteString.Char8 as BS
import           Data.Maybe
import qualified Data.Vector           as V
import qualified Data.Vector.Mutable   as M

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getIntList = readIntList <$> BS.getLine

main=do
    getLine
    a <- getIntList
    let cnt = runST $ do
            vec <- V.thaw $ V.replicate m 0
            forM_ a $ \ai ->
                forM_ (primeFactor ai) $ \j ->
                    M.modify vec (+1) j
            V.freeze vec
    putStrLn$
        if V.and $V.map (<=1) cnt
        then "pairwise coprime"
        else if foldl1 gcd a == 1
            then  "setwise coprime"
            else  "not coprime"
m = 10^6+1

table :: V.Vector Int
table = runST $ do
    vec <- V.thaw $ V.fromList [0..m]
    forM_ (takeWhile (\i -> i*i < m) [2..]) $ \i -> do
        arri <- M.read vec i
        when (arri >= i)$
            forM_ (takeWhile (\j -> i*j < m) [i..]) $ \j -> do
                v <- M.read vec (i*j)
                when (v == i*j) $ M.write vec (i*j) i
    V.freeze vec



primeFactor :: Int -> [Int]
primeFactor 1 = []
primeFactor n = if null prev || head prev /= p
    then p:prev
    else prev
    where p = table V.! n
          prev = primeFactor (n `div` p)
