#include <iostream>
using namespace std;
#define MAXSIZE 1000
int main() {
    int n, m;
    int reader[MAXSIZE], frend[MAXSIZE];
    while (cin >> n >> m) { // 注意 while 处理多个 case
        for(int i=0; i<n; i++)
            cin>>reader[i];
       
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++)
                if(reader[i]==reader[j])
                    frend[i]+=1;
            frend[i]-=1;
        }
        for(int i=0; i<n; i++)
            if(frend[i])
                cout<<frend[i]<<endl;
            else
                cout<<"BeiJu"<<endl;
    }
}
// 64 位输出请用 printf("%lld")