#include <iostream>
#include <string>

using namespace std;

int indexOf(string str, char c)
{
    for(int i=0; i<str.length(); i++)
    {
        if(str[i] == c)
            return i;
    }
    return -1;
}

int indexOfNext(string str, int first_letters)
{
    int a = 97;
    int max_ind = indexOf(str, 'a');
    for(int i=0; i<first_letters; i++)
    {
        char x = (char)(a+i);
        int current_index = indexOf(str, x);
        if(current_index == -1)
            return -1;
        else
        {
            max_ind = max(max_ind, current_index);
        }
    }
    return max_ind;

}


int main ()
{
    unsigned int length, n_letters;
    string letters;

    cin >> length >> n_letters >> letters;


    for(int t=1; t<=length; t++)
    {
        string letters1 = letters.substr(0, (t));
        int next_index = indexOfNext(letters1, n_letters) + 1;
        int i=0;

        while(next_index > 0)
        {
            i++;
            letters1 = letters1.substr(next_index);
            next_index = indexOfNext(letters1, n_letters) + 1;
        }
        cout << i+1 << " ";
    }
    return 0;
}