//题目1156:谁是你的潜在朋友
#include<iostream>
#include<string.h>
using namespace std;
int main(){
int N,M;
int f;
int book[210];
int reader[210];
while(cin>>N){
cin>>M;
memset(book,0,sizeof(book));
for(int i=1;i<N+1;i++){
cin>>reader[i];
book[reader[i]]++;
}
for(int i=1;i<N+1;i++){
if(book[reader[i]]==1){
cout<<"BeiJu"<<endl;
}
else cout<<book[reader[i]]-1<<endl;
}
}
}
#include<iostream>
#include<string.h>
using namespace std;
int main(){
int N,M;
int f;
int book[210];
int reader[210];
while(cin>>N){
cin>>M;
memset(book,0,sizeof(book));
for(int i=1;i<N+1;i++){
cin>>reader[i];
book[reader[i]]++;
}
for(int i=1;i<N+1;i++){
if(book[reader[i]]==1){
cout<<"BeiJu"<<endl;
}
else cout<<book[reader[i]]-1<<endl;
}
}
}