P8651 [Lanquiao Cup 2017 NOI Qualifier B] Date Problem

Description

Xiaoming is organizing a batch of historical documents. Many dates appear in these documents. Xiaoming knows that these dates are all between January 1, 1960 and December 31, 2059. What troubles Xiaoming is that the date formats are not consistent: some use `year/month/day`, some use `month/day/year`, and some use `day/month/year`. Even worse, the first two digits of the year are omitted, which means a single written date in the document may correspond to many possible actual dates. For example, `02/03/04` could mean March 4, 2002; February 3, 2004; or March 2, 2004. Given a date from the document, can you help Xiaoming determine which actual dates it could represent?

Input Format

A date in the form `AA/BB/CC`. ($0\le A, B, C\le 9$)

Output Format

Output several distinct dates, one per line, in the form `yyyy-MM-dd`. Sort the dates from earliest to latest.

Explanation/Hint

Translated by ChatGPT 5