#include <bits/stdc++.h>

using namespace std;

char niz[100005];
bool active[26];
int countCycle;
int finishedCycles;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n, k;
    cin >> n >> k;
    for(int i = 0; i < n; i++) {
        cin >> niz[i];
        if(!active[niz[i] - 'a']) {
            active[niz[i] - 'a'] = true;
            countCycle++;
            if(countCycle == k) {
                finishedCycles++;
                countCycle = 0;
                for(int j = 0; j < 26; j++) active[j] = false;
            }
        }
        cout << finishedCycles + 1 << " ";
    }
}