#include<stdio.h>

FILE *fin,*fout;

int n,m,i,l[500000],d[500000],br,t,p,bra ,brb;
char c[500000];

int main()
{
 fin=fopen("muzej.in","r");
 fout=fopen("muzej.out","w");
 fscanf(fin,"%d%d",&n,&m);
 fscanf(fin,"%s",c);
 if(c[0]=='a')
  l[0]=1;
 else
  l[0]=-1;
 for(i=1;i<n;i++)
 {
  if(c[i]=='a')
  {
   l[i]=l[i-1]+1;
   if(i<m)
    bra++;
  }
  else
  {
   brb++;
   l[i]=l[i-1]-1; 
  }
 }
 for(i=0;i<m;i++)
 {
  br=0;
  while(c[i]=='b' && i<m)
  {
   br++;
   i++;
  }
  if(br>=3)
   bra--;
  fprintf(fout,"%d ",bra);
 }
 fprintf(fout,"%d",bra);
 return 0;
}
