#include<bits/stdc++.h>
using namespace std;
int main ()
{
while(1)
{
map <string,int> a;
map <string,int>::iterator it;
string b;
int i,n,m,ma=0,f[20001]={};
scanf("%d%d",&n,&m);
if(n==0) break;
for(i=0;i<n;i++)
{
cin>>b;
a[b]++;
}
for(it=a.begin();it!=a.end();it++) f[it->second]++;
for(i=1;i<=n;i++) printf("%d\n",f[i]);
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4gKCkKewogICAgd2hpbGUoMSkKICAgIHsKICAgICAgICBtYXAgPHN0cmluZyxpbnQ+IGE7CiAgICAgICAgbWFwIDxzdHJpbmcsaW50Pjo6aXRlcmF0b3IgaXQ7CiAgICAgICAgc3RyaW5nIGI7CiAgICAgICAgaW50IGksbixtLG1hPTAsZlsyMDAwMV09e307CiAgICAgICAgc2NhbmYoIiVkJWQiLCZuLCZtKTsKICAgICAgICBpZihuPT0wKSBicmVhazsKICAgICAgICBmb3IoaT0wO2k8bjtpKyspCiAgICAgICAgewogICAgICAgICAgICBjaW4+PmI7CiAgICAgICAgICAgIGFbYl0rKzsKICAgICAgICB9CiAgICAgICAgZm9yKGl0PWEuYmVnaW4oKTtpdCE9YS5lbmQoKTtpdCsrKSBmW2l0LT5zZWNvbmRdKys7CiAgICAgICAgZm9yKGk9MTtpPD1uO2krKykgcHJpbnRmKCIlZFxuIixmW2ldKTsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==