import time input() while 1:m=input();print m,time.strftime('%B',[m]*8+[1])