//CodoJam2012
#include<stdio.h>
#include<string.h>
int main()
{
int n,i,j,l,k;
char a[110]={" "};
freopen("2012a.in","r",stdin);
freopen("2012a.out","w",stdout);
scanf("%d",&n);
scanf("\n");
for (i=1;i<=n;i++)
{
k=0;
scanf("%c",&a[k]);
while (a[k]!='\n')
{
k++;
scanf("%c",&a[k]);
}
l=strlen(a)-1;
printf("Case #%d: ",i);
for (j=0;j<=k;j++)
{
switch (a[j])
{
case 'a':printf("y");break;
case 'b':printf("h");break;
case 'c':printf("e");break;
case 'd':printf("s");break;
case 'e':printf("o");break;
case 'f':printf("c");break;
case 'g':printf("v");break;
case 'h':printf("x");break;
case 'i':printf("d");break;
case 'j':printf("u");break;
case 'k':printf("i");break;
case 'l':printf("g");break;
case 'm':printf("l");break;
case 'n':printf("b");break;
case 'o':printf("k");break;
case 'p':printf("r");break;
case 'q':printf("z");break;
case 'r':printf("t");break;
case 's':printf("n");break;
case 't':printf("w");break;
case 'u':printf("j");break;
case 'v':printf("p");break;
case 'w':printf("f");break;
case 'x':printf("m");break;
case 'y':printf("a");break;
case 'z':printf("q");break;
case ' ':printf(" ");break;
}
}
printf("\n");
}
fclose(stdin);
fclose(stdout);
return 0;
}