#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n, k;
    cin >> n >> k;
    string s;
    bool k1g = false, k2g = false, k3g = false, k4g = false, k5g = false;
    string si = "";
    cin.ignore();
    getline(cin, s);
    vector <int> r(n);
    r[0] = 1;
    if (n > 1){
        if (s[0] == s[1]){
            r[1] = 1;
        }
        else{
            r[1] = 2;
        }
        if (n == 3){
            if (s == "aaa" || s == "bbb"){
                r[2] = 1;
            }
            else{
                r[2] = 2;
            }
        }
        if (n == 4){
            if (s == "aabb" || s == "abab" || s == "abba" || s == "baab" || s == "baba" || s == "bbaa"){
                r[3] = 3;
            }
            else if (s == "aaaa" || s == "bbbb"){
                r[3] = 1;
            }
            else{
                r[3] = 2;
            }
        }
        if (n == 5){
            if (s == "aaaaa" || s == "bbbbb"){
                r[4] = 1;
            }
            else if(s == "abaaa" || s == "aabaa" || s == "aaaba" || s == "aaaab" || s == "abbbb" || s == "baaaa" || s == "babbb" || s == "bbabb" || s == "bbbab" || s == "bbbba"){
                r[4] = 2;
            }
            else{
                r[4] = 3;
            }
        }
    }
    for (int i = 0; i < n; i++){
        cout << r[i] << ' ';
    }
    return 0;
}