fun main(args: Array<String>) {
    val n = readInputLine().toInt()
    val canUseCharCount = Array<Int>(26, { Int.MAX_VALUE })
    
    for (i in 1..n) {
        val s = readInputLine().toCharArray()
        
        for (j in 0 until 26) {
            val count = s.count { it == 'a' + j }
            
            if (count < canUseCharCount[j]) {
                canUseCharCount[j] = count
            }
        }
    }
    
    for (i in 0 until 26) {
        for (j in 1..canUseCharCount[i]) {
            print(('a' + i).toString())
        }
    }
    
    println()
}

fun readInputLine(): String {
    return readLine()!!
}
