Year 2000

No attempts yetTime limit1sMemory limit128 MB

Problem

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:

  • A year numbered 24 or less belongs to the 2000s (e.g. 16 means 2016).
  • A year numbered 25 or more belongs to the 1900s (e.g. 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, and
  • Month 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:

  • A date must lie entirely on a single line; a date split across two lines is not recognized.
  • A date must not be immediately adjacent to a letter or a digit on either side. For example, none of 78November 01, 88, 6801/12/03, or 02/03/04x are recognized.
  • Field values are only range-checked, never checked for real-calendar validity. Impossible dates such as 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.

Input

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.

Output

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.