fun main(args: Array<String>?): Unit {
    println(Array(readLine()!!.toInt()){ readLine()!!.trim()}.map{w -> ('a' .. 'z').map{a -> w.count{c -> c == a}}.toIntArray()}.let{a -> ('a' .. 'z').map{c -> c.toString().repeat(a.map{l -> l[c - 'a']}.min()!!)}}.joinToString(""))
}
