import java.lang.StringBuilder

fun main(arr: Array<String>) {
    val n = readLine()!!.toInt()
    val s = (1..n).map { readLine()!! }
    val cnt = mutableMapOf<Char, Int>()
    for(key in ('a'..'z')) {
        val c = s.map { it.count { it == key } }.min()!!
        cnt[key] = c
    }
    val ans = StringBuilder()
    for(key in cnt.keys.sorted()) {
        ans.append("".padStart(cnt[key]!!, key))
    }
    println(ans.toString())
}
