#include <iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#define READ freopen("in.txt","r",stdin);
using namespace std;
int main()
{
// READ
int test;
char ss[20000];
scanf("%d",&test);
getchar();
getchar();
for(int k=1;k<=test;k++)
{
printf("Case #%d:\n",k);
while(gets(ss))
{
if(ss[0]=='\0') break;
char *ptr;
ptr=strtok(ss," ");
int i=1;
while(ptr!=NULL)
{
string s=ptr;
if(s.length()>=i)
{
cout<<s[i-1];
i++;
}
ptr=strtok(NULL," ");
}
printf("\n");
}
if(k!=test) printf("\n");
}
return 0;
}
#include<cstdio>
#include<cstring>
#include<vector>
#define READ freopen("in.txt","r",stdin);
using namespace std;
int main()
{
// READ
int test;
char ss[20000];
scanf("%d",&test);
getchar();
getchar();
for(int k=1;k<=test;k++)
{
printf("Case #%d:\n",k);
while(gets(ss))
{
if(ss[0]=='\0') break;
char *ptr;
ptr=strtok(ss," ");
int i=1;
while(ptr!=NULL)
{
string s=ptr;
if(s.length()>=i)
{
cout<<s[i-1];
i++;
}
ptr=strtok(NULL," ");
}
printf("\n");
}
if(k!=test) printf("\n");
}
return 0;
}