#include <iostream>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    string a;
    cin >> a;

    int leks = 1;
    char pre = a[0];

    for (int i = 1; i<n; i++) {
        if (a[i] < pre) {
            leks = 0;
            break;
        }
        pre = a[i];
    }

    pre = a[0];
    int promene = 0;
    if (leks) {
        for (int i = 1; i<n; i++) {
            if (a[i] != pre) promene++;
            pre = a[i];
            if (promene >= k-1) cout << 2 << " ";
            else cout << 1 << " ";
        }
    } else cout << 0;

    return 0;
}