#include <iostream>
using namespace std;
int main(){
int s, t, w;
cin >> s >> t >> w;
string str;
cin >> str;
char lastletter = 'a' - 1 + t;
for (int i = 1; i <= 5; i ++ ){
int pos = -1;
for (int j = str.size() - 1; j >= 0; j -- ){
if(str[j] + (w-j-1) < lastletter){
str[j]++;
pos = j;
break;
}
}
if(pos == -1)return 0;
for (int j = pos+1; str[j]; j ++ ){
str[j] = str[j - 1] + 1;
}
cout << str << endl;
}
return 0;
}
这道题保证了能输出w的长度,所以知道了t就不需要s了