#include<iostream>
#include<map>
using namespace std;

int main() {
	int n,m;
	map<int, int> mymap1,mymap2;

	while (cin >> n >> m) {
		mymap1.clear();
		mymap2.clear();
		for (int i = 1; i <= n; i++) {
			int temp;
			cin >> temp;
			mymap1[i] = temp;  //记录每个人看的书
		}
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				if (mymap1[i] == mymap1[j])
					mymap2[i]++;
			}
			
		}
		for (map<int, int>::iterator it = mymap2.begin(); it != mymap2.end(); it++) {
			if (it->second >= 2) {
				cout << it->second - 1 << endl;
			}
			else cout << "BeiJu" << endl;
		}

	
	}


	return 0;
}