#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) { cerr << to_string(h); if(sizeof...(t)) cerr << ", "; DBG(t...);}
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)

const int N = 2e5 + 3;
const int inf = 1e9;
const int B = 27;
int freq[B];

void solve() {
    int n, k; cin >> n >> k;
    string s; cin >> s;
    s = " " + s;
    int ans = 1;
    for (int i = 1; i <= n; i++) {
        freq[s[i] - 'a']++;
        bool ima = true;
        for (int j = 0; j < k; j++) {
            if (freq[j] == 0) {
                ima = false;
            }
        }
        if (ima) {
            ans++;
            for (int j = 0; j < k; j++)
                freq[j] = 0;
        }

        cout << ans << " ";
    }
    cout << "\n";
}

int main() {
    int t=1; //cin >> t;
    while (t--) {
        solve();
    }
}