import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import Data.List (group, sort, sortOn)

main :: IO ()
main = do
  (n : _) <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  ss <- sequence . replicate n $ T.getLine :: IO [T.Text]
  let
    ss' :: [(Int, T.Text)]
    ss' = sortOn (negate . fst) . map ((,) <$> length <*> head) . group . sort $ ss
    m :: Int
    m = fst . head $ ss'
  mapM_ (T.putStrLn . snd) . takeWhile ((== m) . fst) $ ss'

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