#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
unordered_map<string, string> mp;
mp["ChuiZi"] = "Bu";
mp["Bu"] = "JianDao";
mp["JianDao"] = "ChuiZi";
string s;
int i = 0;
while (cin >> s && s != "End")
{
i++;
if (i % (n + 1) == 0) cout << s << endl;
else cout << mp[s] << endl;
}
return 0;
}