fun main(args: Array) { val a = readLine()!!.trim() val s = readLine()!!.trim() val ans = s.map { if(it in '0'..'9') a[it.toString().toInt()] else it}.joinToString("") println(ans) }