Hide

Problem L
Passport Dates

Languages en is
/problems/vegabrefadagsetningar/file/statement/en/img-0001.jpg
An Icelandic passport.

Konráð has managed to obtain a big pile of Icelandic passports (don’t ask, don’t tell anyone either). Now he has the fun task ahead of him of getting all of the data he wants from the passports. He constructed a small robot arm to automatically open each one of them and take pictures of the relevant data. Then he threw together some image processing code to turn the pictures into the text he wanted from them. This was of course the simple part, now comes the tough part. Converting the format of the data to the ISO-8601 standard.

He has lots of lines of text from Icelandic passports of the format dd ISM /ENM yy where dd is the day of the month, ISM is a three letter abbreviation of a month in Icelandic, ENM is a three letter abbreviation of a month in English and yy are the last two digits of the year. This date says when the passport will expire.

He wants to change this data to the format yyyy-mm-dd where yyyy is the full year, mm is the month and dd the day of the month. All these numbers, both here and above, will have a fixed number of digits, so for example $7$ will be formatted as 07.

All the passports in the input will expire somewhere in the range $2015$ and $2035$. The date when this contest took place is eighth of March $2025$.

The Icelandic month name abbreviations are JAN, FEB, MAR, APR, MAÍ, JÚN, JÚL, ÁGÚ, SEP, OKT, NÓV, DES.

The English month name abbreviations are JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC.

Input

One line of text from a passport as described above.

Output

The date from the passport in ISO-8601 format, as described above.

Scoring

Group

Points

Constraints

1

10

All dates are exactly the day today (day of the contest).

2

25

All dates are in this month (month of the contest).

3

50

All dates are in the year $2024$.

4

15

No further constraints.

Sample Input 1 Sample Output 1
08 MAR /MAR 25
2025-03-08
Sample Input 2 Sample Output 2
08 OKT /OCT 24
2024-10-08

Please log in to submit a solution to this problem

Log in