#include <stdio.h>
#include <string.h>

int main(){
    int tc,length;
    scanf("%d",&tc);
    for(int i=1;i<=tc;i++){
        scanf("%d",&length);
        int x=0;
        char in[length+1];
        char res[length];
        scanf(" %[^\n]s",in);
        for(int j=0;j<length;j++){
            res[x] = in[j];
            x++;
            if(in[j]==' '){
                j++;
                while(in[j]!=' '){
                    j++;
                }
            }
        }
        printf("Case #%d: ",i);
        for(int j=0;j<x;j++){
            printf("%c",res[j]);
        }
        printf("\n");
    }
    return 0;
}