import java.util.Scanner;
public class d072{
public static void main(String[]argv){
int year,time;
Scanner sc=new Scanner(System.in);
time=sc.nextInt(); //要求打幾行
for(int i=1;i<=time;i++){
year=sc.nextInt();
if((year%4==0 && year%100!=0) || year%400==0)
System.out.println("Case"+" "+i+":"+" "+"a leap year");
else
System.out.println("Case"+" "+i+":"+" "+"a normal year");
}
}
}