#include<iostream>
#include<stdio.h>
#include<string.h>
#include<string>
using namespace std;
char ans[110][6];
int main()
{
int stu, tes, sco[110], big[110], sma[110];
int wrong[110] = { 0, };
scanf("%d%d", &stu, &tes);
for (int i = 0; i < tes; i++)
{
scanf("%d%d%d", &sco[i], &big[i], &sma[i]);
for (int j = 0; j < sma[i];)
{
char c;
scanf("%c", &c);
if ((c>='a')&&(c<='e'))
ans[i][j++] = c;
}
}
int flag, score;
char str[3];
getchar();
int p = 0;
for (int i = 0; i < stu; i++)
{
score = 0;
for (int j = 0; j < tes; j++)
{
flag = 1;
scanf("%s", str); p++;
int cou = str[1] - '0';
if (cou != sma[j])
flag = 0;
for (int k = 0; k < cou; k++)
{
scanf("%s", str); p++;
if (str[0] != ans[j][k])
flag = 0;
}
if (flag)
score += sco[j];
else
wrong[j]++;
}
cout << score << endl;
}
int most = 0, po;
for (int i = 0; i < tes; i++)
{
if (most < wrong[i])
most = wrong[i];
}
if (most > 0)
{
cout << most;
for (int i = 0; i < tes; i++)
{
if (most == wrong[i])
cout << " " << i + 1;
}
}
else
cout << "Too simple";
system("pause");
return 0;
}
06-11
416
11-18