public class D072{
public static void main(String[] args){
java.util.Scanner sc = new java.util.Scanner(System.in);
while(sc.hasNext()){
int round = sc.nextInt();
for(int i = 0; i < round; i++)
print(isLeapYear(sc.nextInt()), i + 1);
}
}
public static boolean isLeapYear(int y) {
return y % 400 == 0 ? true : (y % 4 == 0 && y % 100 != 0) ? true : false;
}
public static void print(boolean b, int i){
System.out.print("Case " + i + ": ");
if(b) System.out.println("a leap year");
else System.out.println("a normal year");
}
}