#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m, a[205], cnt;
cin >> n >> m;//输入第一行的n和m
for(int i = 1; i <= n; ++i)//输入组数a[i]
cin >> a[i];
for(int i = 1; i <= n; ++i)//双重循环
{
cnt = 0;//与i喜欢同一本书的人数
for(int j = 1; j <= n; ++j)
if(a[j] == a[i])//如果有喜欢的人则cnt++
cnt++;//满足条件+1
cnt--;//减去自己
if(cnt == 0)
cout << "BeiJu" << endl;//如果没有输出悲剧
else
cout << cnt << endl;//否则输入cnt
}
return 0;
}