#include <bits/stdc++.h>

using namespace std;

const int M = 210;
const int N = 1e6;
int book[M];
int reader[N];

int main(){
	
	int n, m;
	cin >> n >> m;
	for (int i=0; i<n; i++){
		int book_num;
		cin >> book_num;
		reader[i] = book_num;
		book[book_num] ++;
	}
	
	for (int i=0; i<n; i++){
		int t = book[reader[i]];
		if (t > 1){
			printf("%d\n", t-1);
		}
		else{
			puts("BeiJu");
		}
	}
	
	
	return 0;
}