#include<cstdio>
#include<iostream>
#include <algorithm>
#include<cstring>
#include<sstream>
#include <cmath>
#include <set>
#include<map>
#include <vector>
#define ll long long
using namespace std;
const int N = 1e4+5;
string s[3]={"ChuiZi","JianDao","Bu"};
string uns[3]={"Bu","ChuiZi","JianDao"};
int main()
{
int k,cnt = 0;
string str;
cin>>k;
while(cin>>str)
{
if(str == "END")return 0;
cnt++;
for(int i = 0;i < 3;i++)
{
if(str == s[i])
{
if(cnt == k+1)
{
cout<<str<<endl;
cnt = 0;
}
else
cout<<uns[i]<<endl;
}
}
}
return 0;
}