#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
int alpha[5]={1,2,4,8,16};
int opt[1000][1000]={0};
vector<int> fullScroe(m), trueOpt(m);
vector<vector<int> >error(m);
int allOptNum,trueOptNum;
int maxError=0;
for(int i=0;i<m;i++){
cin>>fullScroe[i]>>allOptNum>>trueOptNum;
for(int j=0;j<trueOptNum;j++){
char c;
cin>>c;
trueOpt[i]+=alpha[c-'a'];
}
error[i].resize(5);
}
for(int i=0;i<n;i++){
double grade=0.0;
for(int j=0;j<m;j++){
getchar();
getchar();
int temp;
cin>>temp;
for(int k=0;k<temp;k++){
char c;
cin>>c;
opt[i][j]+=alpha[c-'a'];
}
getchar();
int e;
e=opt[i][j]^trueOpt[j];
if(e){
if((opt[i][j] | trueOpt[j])==trueOpt[j]){
grade+=fullScroe[j]*1.0/2;
}
if(e & alpha[0]) error[j][0]++;
if(e & alpha[1]) error[j][1]++;
if(e & alpha[2]) error[j][2]++;
if(e & alpha[3]) error[j][3]++;
if(e & alpha[4]) error[j][4]++;
}else{
grade+=fullScroe[j];
}
}
printf("%.1lf\n",grade);
}
for(int i=0;i<m;i++){
for(int j=0;j<5;j++){
maxError=maxError>error[i][j]? maxError:error[i][j];
}
}
if(maxError==0){
printf("Too simple");
}else{
for(int i=0;i<m;i++){
for(int j=0;j<5;j++){
if(maxError==error[i][j]){
printf("%d %d-%c\n",maxError,i+1,'a'+j);
}
}
}
}
return 0;
}