#C6302. Unique Submission Identifiers

    ID: 50048 Type: Default 1000ms 256MiB

Unique Submission Identifiers

Unique Submission Identifiers

In this problem, you are given a sequence of usernames corresponding to submissions. For each submission, your task is to generate a unique identifier in the format (X-y), where (X) is the username and (y) is a non-negative integer starting from 0 that increments with each subsequent submission by the same user.

For example, if the input is:

5
john
jane
john
jane
john

Then the correct output is:

john-0
jane-0
john-1
jane-1
john-2

Your solution should read from standard input (stdin) and output the answer to standard output (stdout).

inputFormat

The first line contains an integer (n) which is the number of submissions. Each of the following (n) lines contains a single username, which is a non-empty string without spaces.

outputFormat

Output (n) lines. The (i)-th line should contain the unique identifier for the (i)-th submission corresponding to the input order, following the format (username-index).## sample

5
john
jane
john
jane
john
john-0

jane-0 john-1 jane-1 john-2

</p>