func_code_string: #include <bits/stdc++.h>   using namespace std;   using ll = long long;   char change(char c) {     if (c ==  B ) {       return  W ;     }     return  B ;   }   int main() {     int n, k;     cin >> n >> k;     string s;     cin >> s;     int good = -1;     vector<int> start(n, -1);     for (int i = 0; i != n; ++i) {       if (s[(i + n - 1) % n] == s[i] || s[i] == s[(i + 1) % n]) {         start[i] = 0;         good = i;       }     }     if (good == -1) {       for (int i = 0; i != n; ++i) {         start[i] = k + 1;       }     } else {       for (int i = (good + 1) % n; i != good;) {         if (start[i]) {           int cnt = 0;           while (start[(i + cnt) % n]) {             ++cnt;           }           int pos = 1;           while (pos != cnt + 1) {             start[(i + pos - 1) % n] = min(pos, cnt - pos + 1);             ++pos;           }           i = (i + cnt) % n;         } else {           i = (i + 1) % n;         }       }     }     for (int i = 0; i != n; ++i) {       if (min(k, start[i]) & 1) {         cout << change(s[i]);       } else {         cout << s[i];       }     }   }   