import Control.Monad (replicateM)
import Data.List (intersect, sort)

solve s = foldl intersect (head s') (tail s')
    where
        s' = map sort s

main = do
    n <- readLn
    s <- replicateM n getLine
    putStrLn $ solve s