output_list = []
filename_dict = {}
import sys
for line in sys.stdin:
    if ord(line[0]) == 10:
        break
    else:
        s = list(line.split())
        file_name = list(s[0].split('\\'))[-1]
        filename = file_name + ' ' + s[1]
        if filename not in filename_dict:
            filename_dict[filename] = 1
        else:
            num = filename_dict[filename] + 1
            filename_dict[filename] = num
            if len(file_name) > 16:
                file_name = file_name[-16:]
            output_list.remove(file_name + ' ' + s[1] + " " + str(filename_dict[filename]-1))
        if len(file_name) > 16:
            file_name = file_name[-16:]
        output = file_name + ' ' + s[1] + " " + str(filename_dict[filename])
        output_list.append(output)

for i in range(len(output_list)):
    print(output_list[i])
import os

47ba86805cf98cd7e5a853c0f7fd79db2ec664f7
<mask token>

<mask token>
for line in sys.stdin:
    if ord(line[0]) == 10:
        break
    else:
        s = list(line.split())
        file_name = list(s[0].split('\\'))[-1]
        filename = file_name + ' ' + s[1]
        if filename not in filename_dict:
            filename_dict[filename] = 1
        else:
            num = filename_dict[filename] + 1
            filename_dict[filename] = num
            if len(file_name) > 16:
                file_name = file_name[-16:]
            output_list.remove(file_name + ' ' + s[1] + ' ' + str(
                filename_dict[filename] - 1))
        if len(file_name) > 16:
            file_name = file_name[-16:]
        output = file_name + ' ' + s[1] + ' ' + str(filename_dict[filename])
        output_list.append(output)
for i in range(len(output_list)):
    print(output_list[i])
<mask token>

output_list = []
filename_dict = {}
<mask token>
for line in sys.stdin:
    if ord(line[0]) == 10:
        break
    else:
        s = list(line.split())
        file_name = list(s[0].split('\\'))[-1]
        filename = file_name + ' ' + s[1]
        if filename not in filename_dict:
            filename_dict[filename] = 1
        else:
            num = filename_dict[filename] + 1
            filename_dict[filename] = num
            if len(file_name) > 16:
                file_name = file_name[-16:]
            output_list.remove(file_name + ' ' + s[1] + ' ' + str(
                filename_dict[filename] - 1))
        if len(file_name) > 16:
            file_name = file_name[-16:]
        output = file_name + ' ' + s[1] + ' ' + str(filename_dict[filename])
        output_list.append(output)
for i in range(len(output_list)):
    print(output_list[i])
<mask token>

output_list = []
filename_dict = {}
import sys
for line in sys.stdin:
    if ord(line[0]) == 10:
        break
    else:
        s = list(line.split())
        file_name = list(s[0].split('\\'))[-1]
        filename = file_name + ' ' + s[1]
        if filename not in filename_dict:
            filename_dict[filename] = 1
        else:
            num = filename_dict[filename] + 1
            filename_dict[filename] = num
            if len(file_name) > 16:
                file_name = file_name[-16:]
            output_list.remove(file_name + ' ' + s[1] + ' ' + str(
                filename_dict[filename] - 1))
        if len(file_name) > 16:
            file_name = file_name[-16:]
        output = file_name + ' ' + s[1] + ' ' + str(filename_dict[filename])
        output_list.append(output)
for i in range(len(output_list)):
    print(output_list[i])
import os

output_list = []
filename_dict = {}
import sys
for line in sys.stdin:
    if ord(line[0]) == 10:
        break
    else:
        s = list(line.split())
        file_name = list(s[0].split('\\'))[-1]
        filename = file_name + ' ' + s[1]
        if filename not in filename_dict:
            filename_dict[filename] = 1
        else:
            num = filename_dict[filename] + 1
            filename_dict[filename] = num
            if len(file_name) > 16:
                file_name = file_name[-16:]
            output_list.remove(file_name + ' ' + s[1] + " " + str(filename_dict[filename]-1))
        if len(file_name) > 16:
            file_name = file_name[-16:]
        output = file_name + ' ' + s[1] + " " + str(filename_dict[filename])
        output_list.append(output)

for i in range(len(output_list)):
    print(output_list[i])
import os
