Sort the dates#10992

Sort the dates

1 second
128 megabytes
Very easy

Sort the dates according to the following rules:

Input

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 ).

Output

Print the dates in non-decreasing order in the same format as they were given in the input.

Examples

Example 1

Loading
Loading