#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stdio.h>
#include<string.h>
using namespace std;
int main(){
char a[][] = {"Jia", "Yi", "Bing", "Ding", "Wu", "Ji", "Geng", "Xin", "Ren" , "Gui"};
char b[][] = {"zi", "chou", "yin", "mao", "chen", "si", "wu", "wei", "shen", "you", "xu" , "hai"};
int i,j,flag_a,flag_b,t,num,sample_Value;
scanf("%d",&t);
sample_Value = ;
while(t--){
flag_a = ;
flag_b = ;
scanf("%d",&num); if(num < ) num++; if(num >= sample_Value){
num -= sample_Value;
flag_a = (flag_a + num) % ;
flag_b = (flag_b + num) % ;
printf("%s%s\n",a[flag_a],b[flag_b]);
}
else{
int temp = sample_Value - num;
while(temp--){
flag_a --;
if(flag_a < ){
flag_a +=;
flag_a %= ;
}
flag_b--;
if(flag_b < ){
flag_b += ;
flag_b %= ;
}
}
printf("%s%s\n",a[flag_a],b[flag_b]);
}
}
return ;
}