#include <bits/stdc++.h>
#define MAXN 200005
using namespace std;

string s;
set<char> chars;
int N, K;
int a[MAXN];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin >> N >> K;
    cin >> s;

    a[0] = 1;

    chars.insert(s[0]);

    for (int i = 1; i < N; i++)
    {
        chars.insert(s[i]);
        if (chars.size() >= K)
        {
            a[i] = a[i - 1] + 1;
            chars.clear();
        }
        else
        {
            a[i] = a[i - 1];
        }
    }

    for (int i = 0; i < N; i++)
    {
        cout << a[i] << " ";
    }
    cout << "\n";
    return 0;
}