#include <iostream> using namespace std; const int N = 200; int main() { int n,m; while(cin>>n>>m){ int a[N]; int amap[N]; for(int i=0;i<N;i++)amap[i]=0; for(int i=0;i<n;i++){ cin>>a[i]; amap[a[i]]++; } for(int i=0;i<n;i++){ if(amap[a[i]]>1){ cout<<amap[a[i]]-1<<endl; }else{ cout<<"BeiJu"<<endl; } } } return 0; }