#include <iostream>
#include <vector>
using namespace std;

int countA(string s){
    int a = 0;
    for(int i=0; i<s.size();i++){
        if(s[i] == 'a'){
            a++;
        }
    }
    return a;
}
int countB(string s){
    int b = 0;
    for(int i=0; i<s.size();i++){
        if(s[i] == 'b'){
            b++;
        }
    }
    return b;
}
string CUT(string s,int n){
    string res="";
    for(int i=0; i<n; i++){
        res+=s[i];
    }
    return res;
}

int main(){
    int n,k; cin >> n >> k;
    string s,temp;   cin >> s;
    vector<int> resenja;
    for(int i=1;i<s.size()+1;i++){
            temp = CUT(s,i);
            if(temp == ""){
                resenja.push_back(1);
            }else if(temp == "a" || temp == "b"){
                resenja.push_back(1);
            }else if(temp == "aa" || temp == "bb"){
                resenja.push_back(1);
            }else if(temp == "ab" || temp == "ba"){
                resenja.push_back(2);
            }else if(temp == "aaa" || temp == "bbb"){
                resenja.push_back(1);
            }else if(i == 3){
                resenja.push_back(2);
            }else if(temp == "aaaa" || temp == "bbbb"){
                resenja.push_back(1);
            }else if(temp == "abab" || temp == "abba" || temp == "baba" || temp == "baab"){
                resenja.push_back(3);
            }else if(i == 4){
                resenja.push_back(2);
            }else if(temp == "aaaaa" || temp == "bbbbb"){
                resenja.push_back(1);
            }else if(temp == "aaaab" || temp == "aaaba" || temp == "aaabb" || temp == "aabbb" || temp == "abbbb" || temp == "aabaa" || temp == "abaaa" || temp == "bbbba" || temp == "bbbab" || temp == "bbbaa" || temp == "bbaaa" || temp == "baaaa" || temp == "bbabb" || temp == "babbb"){
                resenja.push_back(2);
            }else{
                resenja.push_back(3);
            }
    }
    for(auto x : resenja){
        cout << x << " ";
    }
}