#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//读取错误记录存入mistake[] 记录数量
//新的记录比较 相同++;不同增加记录 栈
typedef struct mistakeinfo{
char name[20];
int col;
int time;
}mistakeinfo;
int main(){
mistakeinfo mistake[100];
int top=-1;
char str[100],name[20]={'\0'};
int col;
while(scanf("%s %d",str,&col)!=EOF){
int i,j;
int len = strlen(str);
for(i=len-1;i>=0;i--){
//转义控制\\ 定位文件名开始位置
if(str[i]=='\\')
break;
}
if(len-i > 16){
strcpy(name,str+len-16);
}
else{
strcpy(name,str+i+1);
}
int flag = 0; //是否有相同
for(i=0;i<=top;i++){
if(col==mistake[i].col && strcmp(mistake[i].name,name)==0){
flag=1;
mistake[i].time++;
break;
}
}
if(flag==0){
++top;
strcpy(mistake[top].name,name);
mistake[top].col =col;
mistake[top].time =1;
}
}
if(top<8){
for(int i=0;i<=top;i++){
printf("%s %d %d\n",mistake[i].name,mistake[i].col,mistake[i].time);
}
}else{
for(int i=0;i<=7;i++){
printf("%s %d %d\n",mistake[top-7+i].name,mistake[top-7+i].col,mistake[top-7+i].time);
}
}
return 0;
}