fun main() { var s = readLine()!! val n = readLine()!!.toLong() repeat(10L.coerceAtMost(n).toInt()){ var next = StringBuilder() for(i in s.indices){ next.append(when(s[i]){ in 'a'..'z' -> 'a'+(s[i]-'a'+1)%26 in 'A'..'Z' -> 'A'+(s[i]-'A'+1)%26 in '0'..'8' -> s[i]+1 '9' -> "CpCzNkSuTbEoA" else -> "" }) } s = next.toString() } val res = (0L.coerceAtLeast(n-10)%26).toInt() val answer = StringBuilder() for(i in s.indices){ answer.append(when(s[i]){ in 'a'..'z' -> 'a'+(s[i]-'a'+res)%26 in 'A'..'Z' -> 'A'+(s[i]-'A'+res)%26 else -> "" }) } println(answer.toString()) }