You need to fix two-digit years in a document, Y2K style.
You are given a document made of lines of text that may contain dates written with two-digit years. Rewrite the document so that every recognized two-digit year is expanded to a four-digit year, using this rule:
16 means 2016).26 means 1926).A date is recognized only if it appears in one of these three formats:
dd/mm/yy
yy.mm.dd
Month dd, yy
where:
dd is a two-digit day from 01 to 31,mm is a two-digit month from 01 to 12,yy is a two-digit year from 00 to 99, andMonth is one of January, February, March, April, May, June, July, August, September, October, November, December.The first two formats contain no spaces. In the third format there is exactly one space after Month and exactly one space after the comma (so it looks like March 03, 21).
Recognition rules:
78November 01, 88, 6801/12/03, or 02/03/04x are recognized.February 30, 99 are still recognized and expanded.For every recognized date, replace only its two-digit year with the corresponding four-digit year; leave every other character of the document exactly as it is.
The first line contains a positive integer $n$ — the number of lines of text that follow. Each of the next $n$ lines is a line of the document.
Print the $n$ lines of the document, in order, with every recognized two-digit year replaced by its four-digit year. All other characters are unchanged.