#include using namespace std; using ll = long long; string S; vector X; vector DP, DP2; int N; ll K; ll calc(int x); ll calc2(int x); ll calc(int x) { if (DP[x] != -1) return DP[x]; if (x >= (int)X.size() - 1) { DP[x] = 1; return 1; } string a = X[x] + X[x + 1]; if (a.find('j') != string::npos || a.find('t') != string::npos) { ll ANS = calc(x + 1); DP[x] = ANS; return ANS; } int ai = stoi(a); if ((11 <= ai && ai <= 19) || (21 <= ai && ai <= 26)) { ll ANS = calc(x + 2) * 2 + calc2(x + 1); DP[x] = ANS; return ANS; } else { ll ANS = calc(x + 1); DP[x] = ANS; return ANS; } } ll calc2(int x) { if (DP2[x] != -1) return DP2[x]; if (x >= (int)X.size() - 1) { DP2[x] = 0; return 0; } string a = X[x] + X[x + 1]; if (a.find('j') != string::npos || a.find('t') != string::npos) { DP2[x] = 0; return 0; } int ai = stoi(a); if ((11 <= ai && ai <= 19) || (21 <= ai && ai <= 26)) { ll ANS = calc(x + 2); DP2[x] = ANS; return ANS; } else { DP2[x] = 0; return 0; } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> N >> K; cin >> S; if (K == 1) { string ANS; for (int i = 0; i < N; i++) { ANS.push_back((char)(S[i] - '0' + 96)); } cout << ANS << "\n"; return 0; } int ind = 0; while (ind < N) { if (ind + 1 < N && S[ind + 1] == '0') { if (S[ind] == '1') X.push_back("j"); else X.push_back("t"); ind += 2; } else { X.push_back(string(1, S[ind])); ind++; } } DP.assign(X.size() + 10, -1); DP2.assign(X.size() + 10, -1); ind = 0; string ANS; while (ind < (int)X.size()) { int OK = ind; int NG = (int)X.size() - 1; while (NG > OK + 1) { int mid = (OK + NG) / 2; ll score = calc(mid); if (score >= K) OK = mid; else NG = mid; } K -= calc(OK + 1); for (int i = ind; i < OK; i++) { if (X[i] == "j" || X[i] == "t") ANS += X[i]; else ANS.push_back((char)(stoi(X[i]) + 96)); } ANS.push_back((char)(stoi(X[OK] + X[OK + 1]) + 96)); ind = OK + 2; if (K == 1) { for (int i = ind; i < (int)X.size(); i++) { if (X[i] == "j" || X[i] == "t") ANS += X[i]; else ANS.push_back((char)(stoi(X[i]) + 96)); } break; } } cout << ANS << "\n"; return 0; }