#include <iostream>

using namespace std;

int main()
{
    int n,k;
    cin>>n>>k;
    char s[n+1]={'\0'};
    cin>>s;
    cout<<1;
    for(int i=1;i<n;i++)
    {
        if(s[i]!='a'+k-1) cout<<" "<<1;
        else cout<<" "<<2;
    }
}