#include <bits/stdc++.h> using namespace std; int main ( ) { char arr[101],a[101], b[101],c[101],d[101], e[101],f[101],g[101], h[101],in[101], jn[101]; int val,i, tc,cases = 1 ; cin>>tc; while (tc--) { scanf ( "%s %d" , a ,&arr[0]); scanf ( "%s %d" , b ,&arr[1]); scanf ( "%s %d" , c ,&arr[2]); scanf ( "%s %d" , d ,&arr[3]); scanf ( "%s %d" , e ,&arr[4]); scanf ( "%s %d" , f ,&arr[5]); scanf ( "%s %d" , g ,&arr[6]); scanf ( "%s %d" , h ,&arr[7]); scanf ( "%s %d" , in ,&arr[8]); scanf ( "%s %d" , jn ,&arr[9]); val = 0 ; for ( i=0;i<10;i++ ) { if ( arr[i] > val ) { val= arr[i] ; } } cout<<"Case #"<<cases++<<":"<<endl; for(int j=0;j<10;j++) { if(arr[j]==val) { if(j==0) printf("%s\n",a); if(j==1) printf("%s\n",b); if(j==2) printf("%s\n",c); if(j==3) printf("%s\n",d); if(j==4) printf("%s\n",e); if(j==5) printf("%s\n",f); if(j==6) printf("%s\n",g); if(j==7) printf("%s\n",h); if(j==8) printf("%s\n",in); if(j==9) printf("%s\n",jn); } } } return 0 ; }