#include <iostream>
using namespace std ;
int main ()
{
int t , n , i ,it ,x,y,m,k ,a ;
cin>>t ;
for (it=1 ; it<=t ; it++)
{
cin>>n ;
int cx=0 , cy=0 ;
for (i=1 ; i<=n ; i++)
{
cin>>a ;
x=a/30 ;
y=a/60 ;
m=a%30 ;
k= a%60 ;
if( m == 0 || m !=0) x++ ;
if (k !=0 || k == 0) y++ ;
// cout<<x<<" "<<y<<endl ;
cx=cx+x*10 ;
cy=cy+y*15 ;
}
// cout<<cx<<" "<<cy<<endl ;
if (cx==cy) cout<<"Case "<<it<<": Mile Juice "<<cx<<endl ;
else if (cx<cy) cout<<"Case "<<it<<": Mile "<<cx<<endl ;
else if (cx>cy) cout<<"Case "<<it<<": Juice "<<cy<<endl ;
}
return 0 ;
}
using namespace std ;
int main ()
{
int t , n , i ,it ,x,y,m,k ,a ;
cin>>t ;
for (it=1 ; it<=t ; it++)
{
cin>>n ;
int cx=0 , cy=0 ;
for (i=1 ; i<=n ; i++)
{
cin>>a ;
x=a/30 ;
y=a/60 ;
m=a%30 ;
k= a%60 ;
if( m == 0 || m !=0) x++ ;
if (k !=0 || k == 0) y++ ;
// cout<<x<<" "<<y<<endl ;
cx=cx+x*10 ;
cy=cy+y*15 ;
}
// cout<<cx<<" "<<cy<<endl ;
if (cx==cy) cout<<"Case "<<it<<": Mile Juice "<<cx<<endl ;
else if (cx<cy) cout<<"Case "<<it<<": Mile "<<cx<<endl ;
else if (cx>cy) cout<<"Case "<<it<<": Juice "<<cy<<endl ;
}
return 0 ;
}