func_code_string: #include <bits/stdc++.h>   using namespace std;   int N, P;   bool can = false;   string word;   int main() {     scanf( %d%d , &N, &P);     cin >> word;     if (P == 1) {       cout <<  NO n ;       return 0;     } else if (P == 2) {       if (N == 1) {         if (word ==  a )           cout <<  b n ;         else           cout <<  NO n ;       } else if (N == 2) {         if (word ==  ab )           cout <<  ba n ;         else           cout <<  NO n ;       } else if (N > 2)         cout <<  NO n ;       return 0;     }     for (int i = N - 1; i >= 0; --i) {       ++word[i];       while ((i >= 1 && word[i] == word[i - 1]) ||              (i >= 2 && word[i] == word[i - 2]))         ++word[i];       if ((word[i] -  a ) + 1 <= P) {         can = true;         for (int j = i + 1; j < N; ++j) {           word[j] =  a ;           while ((j >= 1 && word[j] == word[j - 1]) ||                  (j >= 2 && word[j] == word[j - 2]))             ++word[j];         }         break;       }     }     if (can)       cout << word;     else       cout <<  NO n ;     return 0;   }   