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