# Modified version of https://yukicoder.me/submissions/1115587 map = "abcdefghijklmnopqrstuvwxyz".chars cnt = 1 hash = {} map.each do |v| hash[v] = cnt hash[cnt] = v cnt += 1 end n,k = gets.split.map(&:to_i) s = gets.chomp.chars.map{|v|v.to_i} # 数え上げ dp = Array.new(n+1, 0) dp[n] = 1 (n-1).downto(0) do |i| # 先頭が 0 を除く if s[i] != 0 # 一桁使う dp[i] += dp[i+1] # 二桁使う if i != n-1 x = s[i..i+1].join.to_i if hash[x] != nil dp[i] += dp[i+2] end end # TLE! This should cause infinitely growing dp[i] # dp[i] = 10**18 if dp[i] > 10**18 end end # 復元 ans = [] i = 0 rest = k while i < n if dp[i+1] >= rest ans << hash[s[i]] i += 1 next end rest -= dp[i+1] if i+1 < n x = s[i..i+1].join.to_i if hash[x] != nil ans << hash[x] i += 2 end end end puts ans.join