exec('from sys import stdin\nfor i,j in zip(map(int,stdin),range(1,int(input())+1)):print((lambda y:"Case "+str(j)+": a leap year" if ((y%4==0) and (y%100!=0)) or (y%400==0) else "Case "+str(j)+": a normal year")(i))')
exec('from sys import stdin\nfor i,j in zip(map(int,stdin),range(1,int(input())+1)):print((lambda y:"Case "+str(j)+": a leap year" if ((y%4==0) and (y%100!=0)) or (y%400==0) else "Case "+str(j)+": a normal year")(i))')