eolymp
bolt
Try our new interface for solving problems
Problems

Sort the dates

Sort the dates

Sort the dates according to the following criteria: \begin{itemize} \item in non-decreasing order of years; \item if the dates have the same year, then sort them in non-decreasing order of months; \item if the dates have the same year and month, then sort them in non-decreasing order of days. \end{itemize} \InputFile The first line contains the number of dates $n~(1 \le n \le 1000)$. Each of the following $n$ lines contains a date in the format \textbf{day.month.year}. Each date is specified with three integers --- day (from $1$ to $31$), month (from $1$ to $12$) and year (from $1900$ to $2021$). \OutputFile Print the dates in non-decreasing order in the same format as they are given in the input.
Time limit 1 second
Memory limit 128 MiB
Input example #1
10
16.5.2003
28.9.2016
17.12.2009
25.1.2005
28.1.2001
5.7.1999
22.7.2020
28.1.2018
24.5.2005
6.4.2017
Output example #1
5.7.1999
28.1.2001
16.5.2003
25.1.2005
24.5.2005
17.12.2009
28.9.2016
6.4.2017
28.1.2018
22.7.2020
Author Michael Medvediev