#include <iostream>
#include <map>
using namespace std;
const int N = 201;
int a[N];
int book[N];

int main(){
    int n, m;
    cin >> n >> m;
    for(int i = 0; i < n; i ++){
        cin >> a[i];
        book[a[i]] ++;
    }
    for(int i = 0; i < n; i ++){
        if(book[a[i]] - 1 == 0)
            cout << "BeiJu" << endl;
        else
            cout << book[a[i]] - 1 << endl;
    }

    return 0;
}