fun main() { val a = readLine()!! println(readLine()!!.toCharArray().map { when (it) { in 'a'..'z' -> it else -> a[it - '0'] } }.joinToString("")) }