#include <bits/stdc++.h>
using namespace std;
map<string, pair<long long, int>> mp;
map<string, bool> pick;
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n, f;
cin >> n >> f;
string s;
cin >> s;
set<string> st;
for(int x = 0; x < s.length() - 2; x++){
string s1 = s.substr(x, 3);
if((s1[0] != s1[1] && s1[0] != s1[2]) && s1[1] == s1[2]){
mp[s1].first++;
mp[s1].second = x;
if(mp[s1].first >= f){
st.insert(s1);
}
}
for(int i = 0; i < 3; i++){
s1 = s.substr(x, 3);
for(int j = 0; j < 26; j++){
s1[i] = char('a' + j);
if((s1[0] == s1[1] || s1[0] == s1[2]) || s1[1] != s1[2]) continue;
if(s1[0] == s1[2] || s1 == s.substr(x, 3) || pick[s1] || (x - mp[s1].second < 3 && mp[s1].first > 0)) continue;
pick[s1] = true;
mp[s1].first++;
mp[s1].second = x;
if(mp[s1].first >= f){
st.insert(s1);
}
}
}
}
cout << st.size() << endl;
for(string i: st){
cout << i << endl;
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cm1hcDxzdHJpbmcsIHBhaXI8bG9uZyBsb25nLCBpbnQ+PiBtcDsKbWFwPHN0cmluZywgYm9vbD4gcGljazsKCnNpZ25lZCBtYWluKCl7CgljaW4udGllKDApOwoJaW9zOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOwoJaW50IG4sIGY7CgljaW4gPj4gbiA+PiBmOwoJc3RyaW5nIHM7CgljaW4gPj4gczsKCXNldDxzdHJpbmc+IHN0OwoJZm9yKGludCB4ID0gMDsgeCA8IHMubGVuZ3RoKCkgLSAyOyB4KyspewoJCXN0cmluZyBzMSA9IHMuc3Vic3RyKHgsIDMpOwoJICAgIGlmKChzMVswXSAhPSBzMVsxXSAmJiBzMVswXSAhPSBzMVsyXSkgJiYgczFbMV0gPT0gczFbMl0peyAKCSAgICAJbXBbczFdLmZpcnN0Kys7CgkgICAgCW1wW3MxXS5zZWNvb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