#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int walnut,turd,nerd,N,G,P,Jesus=0;
int no[100];
scanf("%d",&N);
for(int i=0;i<N;i++)
{
turd=0,nerd=1,G=0,P=0;
scanf("%d",&walnut);
for(int j=0;j<walnut;j++)
{
scanf("%d",&no[j]);
}
for(int u=0;u<walnut-1;u++)
{
if(no[turd]<no[nerd])
{
++G;
}
else if(no[turd]>no[nerd])
{
++P;
}
turd++,nerd++;
}
printf("Case %d: %d %d\n",++Jesus,G,P);
}
}