#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<stdio.h> #include<string.h> using namespace std; int main(){ char a[10][6] = {"Jia", "Yi", "Bing", "Ding", "Wu", "Ji", "Geng", "Xin", "Ren" , "Gui"}; char b[12][6] = {"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 = 1911; while(t--){ flag_a = 7; flag_b = 11; scanf("%d",&num); if(num < 0) num++; if(num >= sample_Value){ num -= sample_Value; flag_a = (flag_a + num) % 10; flag_b = (flag_b + num) % 12; printf("%s%s ",a[flag_a],b[flag_b]); } else{ int temp = sample_Value - num; while(temp--){ flag_a --; if(flag_a < 0){ flag_a +=10; flag_a %= 10; } flag_b--; if(flag_b < 0){ flag_b += 12; flag_b %= 12; } } printf("%s%s ",a[flag_a],b[flag_b]); } } return 0; }