import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] strs=br.readLine().split(" ");
int n=Integer.parseInt(strs[0]);
int m=Integer.parseInt(strs[1]);
String[] exams=new String[m];
double[] scores=new double[n];//各个学生的分数
String[] wrongs=new String[m];//各个题目错误答案集合
Map<String,Integer> results=new HashMap<String,Integer>();
List<String> output=new ArrayList<String>();
for(int i=0;i<wrongs.length;i++) {
wrongs[i]="";
}
for(int i=0;i<m;i++) {
exams[i]=br.readLine();
}
for(int i=0;i<n;i++) {
String str=br.readLine();
String[] datas=str.substring(1, str.length()-1).split("\\)\\s+\\(");
for(int j=0;j<datas.length;j++) {
String[] exam=exams[j].split(" ");
String[] data=datas[j].split(" ");
// 不包含
if(exams[j].indexOf(datas[j])==-1) {
String a="",b="";
for(int k=3;k<exam.length;k++) {
a+=exam[k];
}
for(int l=1;l<data.length;l++) {
b+=data[l];
}
// 半对
if(abDeal(b,a).equals("")) {
scores[i]+=Integer.parseInt(exam[0])/2.0;
}
wrongs[j]+=abDeal(a,b);
wrongs[j]+=abDeal(b,a);
}else {
scores[i]+=Integer.parseInt(exam[0]);
}
}
System.out.println(scores[i]);
}
for(int i=0;i<wrongs.length;i++) {
Map<String,Integer> result=getAllCounts(wrongs[i],i+1);
results.putAll(result);
}
int max=0;//最大的value
for(Integer value:results.values()) {
if(value>max) {
max=value;
}
}
// 遍历Map集合输出最大value对应的内容
if(max==0) {
System.out.println("Too simple");
}else {
for(Map.Entry<String, Integer> entry:results.entrySet()) {
if(entry.getValue()==max) {
output.add(entry.getValue()+" "+entry.getKey());
}
}
}
Collections.sort(output);
for(int i=0;i<output.size();i++) {
System.out.println(output.get(i));
}
}
// 获得字符串a中b不存在的字符
public static String abDeal(String a,String b) {
String str="";
for(int i=0;i<a.length();i++) {
int flag=0;
for(int j=0;j<b.length();j++) {
if(b.charAt(j)==a.charAt(i)) {
flag=1;
}
}
if(flag==0) {
str+=a.charAt(i);
}
}
return str;
}
// 获得字符串中所有字符的次数
public static Map<String,Integer> getAllCounts(String str,int index){
Map<String,Integer> counts=new HashMap<String,Integer>();
for(int i=0;i<str.length();i++){
String string=index+"-"+str.charAt(i);
if(counts.containsKey(string)) {
counts.put(string, counts.get(string)+1);
}else {
counts.put(string, 1);
}
}
return counts;
}
}