Problem F -- Standard Dates (50 Points)

Inputfile: problemf.dat
Output:    to standard output

Description

You have just been employed to work on the greatest World Wide Web indexer in history. This time, your employer claims, they aim to do it right. The claim to fame of this new system is that it will transform the date fields on every web page so that there will be no ambiguity when people search for "1st April 1995".

In different countries around the world, people store dates in formats such as:

        D/M/YY           e.g.       1/4/95
        D/M/YYYY                    1/4/1995
        M/D/YY                      4/1/95
        M/D/YYYY                    4/1/1995
        D.M.YY or D.M.YYYY          1.4.95 or 1.4.1995 
        M.D.YY or M.D.YYYY          4.1.95 or 4.1.1995 
In the example above both D (for date) and M (for month) may also be replaced with DD and MM. ie. 01/04/95. The new international standard for date specification is known as ISO 8601. The standard format is:
        YYYY-MM-DD       e.g.       1995-04-01
ISO 8601 has many advantages including: It is easily readable and writeable by software, it is easily comparable and sortable with a string comparison, and it cannot be confused with other date formats.

Your task is to read a date that is specified in one of the date formats shown above (including ISO 8601). You will transform them into ISO 8601 format if it is obvious which field is the date and which field is the month. We will assume that any YY field, where YY>20, is referring to 19YY. When YY<=20 we assume the date is referring to 20YY. If it is not obvious which is the date, and which is the month field, output each possible answer. Separate consecutive answers on the same line with a space, and show them in chronological order (eg. 1997-05-09 is before 1997-09-05).

You must read from the file problemf.dat. Each line will contain a single string representing a date. You must output the answer to standard output.

Input
=====
1/13/98
14/12/95
01/28/1950
1/4/95
9/05/00
15.3.2001
1997-02-03

Output
======
1998-01-13
1995-12-14
1950-01-28
1995-01-04 1995-04-01
2000-05-09 2000-09-05
2001-03-15 1997-02-03