Date
You are starting to get annoyed with how your phone shows you the date, so you want to put it into a different format. Currently, your phone gives you the date in the format Month Day, Year (ex. July , ). Your goal is to shorten the format exactly like this, MM/DD/YY
, where M
is month, D
is day, and Y
is year (ex. //). Write a program that will calculate this format change.
Input
The first line will contain a single integer that indicates the number of lines that follow. The next lines will be in the format Month Day, Year. The full year integer will be between and .
Output
Your output should be the same date as the input, but in the new format MM/DD/YY
. If the month, day or year is only one digit, pad with a . If the date is not valid (the month is spelled incorrectly, the day is less than or greater than ), print Invalid. You do not need to check that the day fits within the month's days, just that it is not greater than . The year format will be the last two digits (or digit padded with a ) of the input year.
Input Samples | Output Samples |
---|---|
3
February 5, 990 December 25, 12018 Decembuary 31, 2000 |
02/05/90
12/25/18 Invalid |