// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <iomanip>
#define dibs reserve
#define OVER9000 1234567890
#define patkan 9
#define tisic 47
#define soclose 10e-7
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define chocolate win
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):(x))
// mylittlepony
using namespace std;
	
int main() {
	// freopen("jenga.in","r",stdin);
	int T;
	scanf(" %d",&T);
    for(int t =0; t < T; t++) {
		int N;
		scanf(" %d",&N);
		if(N%3 != 0) printf("Case %d: Bakkar\n",t+1);
		else printf("Case %d: Wahdan\n",t+1);}
    return 0;}
        
// look at my code
// my code is amazing