import os
from collections import Counter

errors = Counter()
error_order = list()
while 1:
    try:
        msg = input()
    except:
        break
    p, l = msg.strip().split(' ')
    #p0 = os.path.basename(p)
    p0 = p.split('\\')[-1][-16:]
    e = f'{p0}_{l}'
    errors[e] += 1
    if e not in error_order:
        error_order.append(e)

for i in error_order[-8:]:
    p0, l = i.split('_')
    print(p0, l, errors[i])

题目的坑挺多的。