# Include < Stdio. h >
# Include < String . H >
Char Haabmonth [ 19 ] [ 10 ] = { " Pop " , " No " , " Zip " , " Zotz " , " Tzec " , " XUL " , " Yoxkin " , " Mol " , " Chen " , " Yax " , " Zac " , " CEH " , " Mac " , " Kankin " , " Muan " , " Pax " , " Koyab " , " Cumhu " , " Uayet " };
Char Hollyday [ 20 ] [ 10 ] = { " Imix " , " Ik " , " Akbal " , " Kan " , " Chicchan " , " CIMI " , " Manik " , " Lamat " , " Muluk " , " OK " , " Chuen " , " EB " , " Ben " , " IX " , " Mem " , " CIB " , " Caban " , " Eznab " , " Canac " , " Ahau " };
Void Work ( Int Haabd, Char * Haabm, Int Year ){
Int I, days; // Days HAAB calendar days
For (I = 0 ; Strcmp (haabm, haabmonth [I]); ++ I ); // Find a month in the habb calendar
Days = I * 20 + Haabd;
Days + = Year * 365 ;
Printf ( " % D % S % d \ n " , 1 + Days % 13 , Hollyday [days % 20 ], Days / 260 ); // This question is really dizzy in English. I still know mod13 only after reading the problem-solving report. I can learn English well !!
Return ;
}
Int Main (){
Int Number;
Scanf ( " % D " , & Number );
Printf ( " % D \ n " , Number );
For ( Int I = 0 ; I < Number; ++ I ){
Int Haabd, year;
Char Haabm [ 10 ];
Scanf ( " % D. % S % d " , & Haabd, haabm, & Year );
Work (haabd, haabm, year );
}
Return 0 ;
}