Sort the dates according to the following rules:
in non-decreasing order of years;
if the years are the same, then in non-decreasing order of months;
if both the year and month are the same, then in non-decreasing order of days.
The first line contains the number of dates (1 \le n \le 1000).
Each of the following lines contains a date in the format day.month.year.
Each date is given by three integers: the day (from to ), the month (from to ), and the year (from to ).
Print the dates in non-decreasing order in the same format as they were given in the input.
Example 1