import java.util.*
import kotlin.collections.ArrayList

class Flow(val to: Int, var flow: Int) {
    private var mPair: Flow? = null
    var pair: Flow
        get() = mPair!!
        set(value) {
            mPair = value
        }
}



fun calMaxFlow(nodes: Array<Array<Flow>>, source: Int, sink: Int): Int {
    val depth = IntArray(nodes.size){-1}
    val searching = IntArray(nodes.size){0}
    val queue: Queue<Int> = ArrayDeque<Int>()
    fun bfs(): Unit {
        depth.fill(-1)
        depth[source] = 0
        queue.add(source)
        while (queue.isNotEmpty()) {
            val top = queue.poll()
            for (flow in nodes[top]) if (flow.flow > 0 && depth[flow.to] == -1) {
                depth[flow.to] = depth[top] + 1
                queue.add(flow.to)
            }
        }
    }
    fun dfs(current: Int, min: Int = Int.MAX_VALUE): Int {
        if (current == sink) return min
        while(searching[current] < nodes[current].size) {
            val flow = nodes[current][searching[current]]
            if (flow.flow > 0 && depth[current] < depth[flow.to]) {
                val f = dfs(flow.to, minOf(min, flow.flow))
                if (f > 0) {
                    flow.flow -= f
                    flow.pair.flow += f
                    return f
                }
            }
            ++searching[current]
        }
        return 0
    }
    var flow = 0
    var hasFlow = true
    while (hasFlow) {
        hasFlow = false
        bfs()
        searching.fill(0)
        var f = dfs(source)
        while(f > 0) {
            flow += f
            hasFlow = true
            f = dfs(source)
        }
    }
    return flow
}

fun makeGraph(counts: Array<IntArray>, base: Int): Array<Array<Flow>> {
    val nodes = Array(28){ArrayList<Flow>()}
    fun setNode(from: Int, to: Int, flow: Int): Unit {
        nodes[from].add(Flow(to, flow))
        nodes[to].add(Flow(from, 0))
        nodes[from].last().pair = nodes[to].last()
        nodes[to].last().pair = nodes[from].last()
    }
    for (i in 0 until 26) if (i != base) {
        for (j in 0 until 26) if (j != base) {
            if (counts[i][j] != 0) setNode(i, j, counts[i][j])
        }
    }
    for (i in 0 until 26) if (i != base) {
        if (counts[base][i] != 0) setNode(26, i, counts[base][i])
        if (counts[i][base] != 0) setNode(i, 27, counts[i][base])
    }
    if (counts[base][base] != 0) setNode(26, 27, counts[base][base])
    return nodes.map{it.toTypedArray()}.toTypedArray()
}
fun main(args: Array<String>) {
    val n = readLine()!!.trim().toInt()
    val words = Array(n){readLine()!!.trim()}
    val counts = Array(26){IntArray(26){0} }
    for (word in words) {
        ++counts[word.first() - 'a'][word.last() - 'a']
    }
    for (c in 'a' .. 'z') {
        if (counts.sumBy{it[c - 'a']} == 0) continue
        if (counts[c - 'a'].sum() == 0) {
            println(c)
            continue
        }
        val graph = makeGraph(counts, c - 'a')
        val flow = calMaxFlow(graph, 26, 27)
        if (counts[c - 'a'].sum() <= flow) {
            println(c)
        }
    }
}
