OpenJudge

15:Valid date format

总时间限制:
10000ms
内存限制:
64000kB
描述

A the softmind's mind,a valid date format should be formed by the forms below:

MM-DD-YYYY
DD-MMM-YYYY
MM/DD/YYYY
YYYY/MM/DD
YYYY/MMM/DD

that the "DD"、"MM" and "YYYY" is three integers ,indicate day、month and year of a date. The "MMM" indicate the month in another way , the string of "MMM" only can be one of {"Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"}.

Of course a day should be no more than 31 , a month should be no more than 12 ,a year should be greater than 1000 ,and another condition you should be consided.

One day ,softmind is very depressed, so he thought that the various of date format let he in confusion, so he need a uniform date format , so the problem comes ,please help him , to convert a valid date to the softmind's standard date format , if the data is not right ,please point out that .

输入
There are several test cases. In each tese case one line contains a string of date .
输出
If the date in the input is valid ,please convert it into standard one then output it ,if it's invalid ,output "Invalid " .
The standard format of the date is: MM-DD-YYYY .
样例输入
04-16-2008
04-Mar-2008
Mar-06-2008 

样例输出
04-16-2008
03-04-2008
Invalid

提示
简单的字符串处理

加油

全局题号
4157
添加于
2011-11-04
提交次数
12
尝试人数
1
通过人数
1