#include "stdio.h"
#include "vector"
using namespace std;
int main(){
int N,M;//N为读者数,M为图书数
int student[210];//记录每个学生喜欢的图书号
vector<int> graph[210];//用向量模拟每个图书对应的学生
while (scanf("%d %d",&N,&M)!=EOF){
for (int i = 0; i < N; ++i) {
scanf("%d",&student[i]);
graph[student[i]].push_back(i);
}
for (int i = 0; i < N; ++i) {
if (graph[student[i]].size() == 1)
printf("BeiJu\n");
else
printf("%d\n",graph[student[i]].size()-1);
}
}
}