#include <iostream>
#include <vector>
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n, k;
    cin >> n >> k;
    vector<int> sed;

    char a;
    for (int i = 0; i < n; i++) {
        cin >> a;
        sed.push_back(a - 96);
    }
    bool eqnum = true;
    for (int i = 1; i <= n; i++) {
            int x = 0, y = 0;
        for (int j = 0; j < i; j++) {
            if (sed[j] == 1) {
                x++;
            } else {
                y++;
            }
        }
        if (x == y) {
            cout << x+1 << " ";
        } else {
            cout << min(x, y) + 1 << " ";
        }
    }


}