#include <stdio.h>
int main ()
{
int l, w, h , t ,i ;
scanf ("%d",&t) ;
for (i=1 ; i<=t ; i++)
{
scanf ("%d %d %d",&l,&w,&h) ;
getchar () ;
if (l>20 || w>20 || h >20) printf ("Case %d: bad\n",i) ;
else printf ("Case %d: good\n",i) ;
}
return 0 ;
}
int main ()
{
int l, w, h , t ,i ;
scanf ("%d",&t) ;
for (i=1 ; i<=t ; i++)
{
scanf ("%d %d %d",&l,&w,&h) ;
getchar () ;
if (l>20 || w>20 || h >20) printf ("Case %d: bad\n",i) ;
else printf ("Case %d: good\n",i) ;
}
return 0 ;
}