fun main(args: Array<String>) {
    abc058c()
}

fun abc058c() {
    val n = readLine()!!.toInt()
    val sMaps = (1..n).map { readLine()!!.groupBy { it } }

    val alphaCount = ('a'..'z').map { c ->
        Pair(c, sMaps.map { sMap -> sMap[c]?.size ?: 0 }.min()!!)
    }

    val answer = alphaCount.joinToString(separator = "") { alp -> alp.first.toString().repeat(alp.second) }

    println(answer)
}
