100 atcoder#ABC113C. [ABC113C] ID
[ABC113C] ID
Score: points
Problem Statement
In Republic of Atcoder, there are prefectures, and a total of cities that belong to those prefectures.
City is established in year and belongs to Prefecture .
You can assume that there are no multiple cities that are established in the same year.
It is decided to allocate a -digit ID number to each city.
If City is the -th established city among the cities that belong to Prefecture , the first six digits of the ID number of City is , and the last six digits of the ID number is .
Here, if or (or both) has less than six digits, zeros are added to the left until it has six digits.
Find the ID numbers for all the cities.
Note that there can be a prefecture with no cities.
Constraints
- are all different.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the ID numbers for all the cities, in ascending order of indices (City , City , ).
2 3
1 32
2 63
1 12
000001000002
000002000001
000001000001
- As City is the second established city among the cities that belong to Prefecture , its ID number is .
- As City is the first established city among the cities that belong to Prefecture , its ID number is .
- As City is the first established city among the cities that belong to Prefecture , its ID number is .
2 3
2 55
2 77
2 99
000002000001
000002000002
000002000003