In the Republic of Atcoder, there are N prefectures and a total of M cities that belong to those prefectures. Each city is associated with the following information:
It was established in a specific year, denoted by Y_i.
It belongs to a particular prefecture, denoted by P_i.
You can assume that there are no multiple cities established in the same year.
It has been decided to allocate a unique 12-digit ID number to each city based on the following criteria:
If city i is the x-th established city among the cities belonging to prefecture P_i, the ID number consists of two parts:
The first six digits represent the prefecture number P_i.
The last six digits represent the order number x of the city in its prefecture.
If either P_i or x has less than six digits, you must pad it with zeros on the left until it has six digits.
Your task is to find the unique ID numbers for all cities.
Input Format
The first line contains two integers N and M:
N: The number of prefectures (1 ≤ N ≤ 100).
M: The number of cities (1 ≤ M ≤ 1000).
The next M lines each contain two integers:
Y_i: The year the city was established (1 ≤ Y_i ≤ 10^9).
P_i: The prefecture number the city belongs to (1 ≤ P_i ≤ N).
Output Format
Output M lines, with each line containing the ID number of the corresponding city in the order they were provided in the input.