import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as T
import qualified Data.Text.Lazy.Read as T
import qualified Data.Vector.Unboxed as VU

main :: IO ()
main = do
  n <- unsafeTextToInt <$> T.getLine :: IO Int
  let
    tallyN :: Int -> [Int] -> VU.Vector Int
    tallyN n = VU.accum (const . succ) (VU.replicate n 0) . map (flip (,) ())
    f :: [Int] -> Maybe Bool
    f as = foldl step (Just True) . map (\i -> sum . map (v VU.!) $ [i, 2 * i .. 1000000]) $ [2 .. 1000000]
      where
        step :: Maybe Bool -> Int -> Maybe Bool
        step c x | x <= 1    = c
                 | x < n     = const False <$> c
                 | otherwise = Nothing
        v = tallyN 1000001 as :: VU.Vector Int
  as <- map unsafeTextToInt . T.words <$> T.getContents :: IO [Int]
  putStrLn $ case f as of
    Just True -> "pairwise coprime"
    Just _    -> "setwise coprime"
    _         -> "not coprime"

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInt #-}
