fun main(args: Array<String>?): Unit {
    val n = readLine()!!.toInt()
    val words = Array(n){ readLine()!!.trim().let{ l ->
        val a = IntArray(26){0}
        for (c in l) a[c - 'a']++
        a
    }}
    println(('a' .. 'z').joinToString(""){c -> c.toString().repeat(words.map{a -> a[c - 'a']}.min()!!)})
}
