There are n people in an old database. Engineers struggle to extract useful information from the dataset as some names collide. You are asked to help them so that they can work with that data. The database contains user names and their birth dates. There are many duplicate names and you are asked to de-duplicate them by adding a number next to them. If there are two people named Anna, then the program should keep the first one and add a 1 to the second one. That will result in Anna and Anna1. If another Anna is present in the database, the program should assign Anna2 to the name.
The first line of the input contains a single integer n. The next n lines contain space-separated names and birthdates.
The program should print n lines, each with a unique name in the described format, and the corresponding birthdate.