#include "string.h"
int main(int argc, char* argv[])
{
char map[] = "yhesocvxduiglbkrztnwjpfmaq";
int line, i;
char c;
scanf("%d\n\r", &line);
for(i=0;i<line;i++) {
printf("Case #%d: ", i+1);
while(scanf("%c",&c) == 1 && c != '\n')
{
printf("%c",c==' '?' ':map[c-'a']);
}
printf("\n");
}
return 0;
}