fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val ss = (1..n).map {
        readLine()!!.toCharArray().map { it.toInt() - 'a'.toInt() }
    }

    var maxfrq=IntArray(26,{50})
    ss.forEach {
        var frq=IntArray(26)
        it.forEach{ frq[it]++ }
        for(i in 0..25){
            maxfrq[i]=Math.min(maxfrq[i],frq[i])
        }
    }

    for(i in 0..25){
        repeat(maxfrq[i]){
            print((i+'a'.toInt()).toChar())
        }
    }
    println()

}