#include<iostream>
using namespace std;
const int N = 1000;
int main() {
int s, t, w, flag = 0;
char a[N];
int j, i, num = 0;
scanf("%d%d%d", &s, &t, &w);//s->min order of alphabet,t is max;w is the bits of num;1??s<T??26, 2??w??t-s ??
scanf("%s", a);
for (;num < 5;num++) {
//TODO
for (i = w - 1; i >= 0; i--) {
//TODO from last bit find that add able num
flag = 0;
if ((a[i] + 1 >= 96 + s) && (a[i] + 1 <= 96 + t)) {
//ascii a->97
if (i != w - 1) {
if (a[i] + 1 < a[i + 1]) {
a[i] += 1;
flag = 1;
}
}
} else {//last bit just need add 1
a[i] += 1;
flag = 1;
}
for (j = i + 1; j <= w - 1 && flag == 1; j++) {
while ((a[j] - 1 >= 96 + s) && (a[j] - 1 <= 96 + t)) {
if (a[j] - 1 > a[j - 1]) {
a[j] = a[j] - 1;
} else {
break;
}
}
}
if (flag == 1) {
break;
}
}
printf("%s\n", a);
}
return 0;
}
``