#include <bits/stdc++.h>
using namespace std;
map<int, int> M;
int main() {
int n,m;
while(cin>>n>>m){
// for(int i=0;i<n;i++) { int tmp;cin>>tmp;M[i]=tmp;}
// for(int i=0;i<n;i++){
// int cnt = 0;
// for(int j=0;j<n;j++){
// if(j == i) continue;
// if(M[i] == M[j]) cnt++;
// }
// if(cnt!=0) cout<<cnt<<endl;
// else cout<<"BeiJu"<<endl;
// }
int a[1000];
for(int i=0;i<n;i++) {int tmp;cin>>tmp;a[i]=tmp;M[tmp]++;}
for(int i=0;i<n;i++){
if(M.find(a[i])!=M.end() && M[a[i]]-1!=0) cout<<M[a[i]]-1<<endl;
else cout<<"BeiJu"<<endl;
}
}
}
// 64 位输出请用 printf("%lld")