import time i=input for k in[i()]*30: w=i() print w,time.strftime('%B',[w]*8+[0])