import Data.Array
import Data.Array.ST

counter::String -> Array Char Int
counter str = runSTArray $ do
  ar<-newArray ('a','z') 0
  mapM_ (count ar) str
  return ar
    where count ar c = do
                    v<-readArray ar c
                    writeArray ar c (v+1)

min_ar::[Array Char Int]->Array Char Int
min_ar ars = array ('a','z') (zip ['a'..'z'] [ minimum [ (ar!c) | ar <-ars ] |  c<-['a'..'z'] ])

create_str::Array Char Int -> String
create_str ar = concat [ take (ar!c) (repeat c)  | c<-['a'..'z'] ]

n_getter::Int->IO [String]
n_getter 0 = return []
n_getter n = do
  str<-getLine
  rest<-n_getter (n-1)
  return (str:rest)

main::IO()
main=do
  nc<-getLine
  dats<-n_getter (read nc)
  putStr (((create_str.min_ar.(map counter)) dats)++"\n")