Most calendar systems work with cyclic time periods to represent dates that identify specific days in the calendar. Our Gregorian calendar, for example, uses days, months and years as time periods.

Quiringa
Eastern side of the Stella C monument in Quiriguá (Guatemala) that indicates the mythological reference date of 0 baktuns, 0 katuns, 0 tuns, 0 uinals and 0 kins. This date corresponds to August 11, 3114 BC in the (proleptic) Gregorian calendar.

The long count of the Maya calendar, on the other hand, works with five time periods instead of three. Every day is called a kin, and every time period of 20 kin is a uinal. 18 uinals are called a tun, 20 tun a katun, and 20 katun are a baktun. There is no upper limit to the number of baktun, just as there is no upper limit to the number of years in the Gregorian calendar.

In addition, time periods of a date in the Gregorian calendar are represented from short to long (days, months, years), whereas those of the Maya calendar go from long to short (baktuns, katuns, tuns, uinals, kins). Finally, the Gregorian calendar numbers values for the time periods starting from 1, whereas the Maya calendar counts from 0.

Assignment

Express a day represented as a date in the Gregorian calendar as its corresponding date in the Maya calendar. For example, the Gregorian date 12/12/2012 corresponds with the date 12.19.19.17.11 in the Maya calendar. Dates are always represented as a string that lists the individual values for each of the time periods. The individual values are always separated by the same character. Any character can be used as a separator, as long as it is not a digit. The individual values are integers, but they may be represented with a random number of leading zeroes that don't have any further meaning. We only take into account days from the Gregorian date 01/01/1970 onward. You are asked to:

Example

>>> dmy('01/01/1970')
(1, 1, 1970)
>>> dmy('20-7-1988')
(20, 7, 1988)
>>> dmy('00012+00012+02012')
(12, 12, 2012)
>>> dmy('21 12 2012')
(21, 12, 2012)
>>> dmy('26.03.2407')
(26, 3, 2407)

>>> expired('01/01/1970')
0
>>> expired('20-7-1988')
6775
>>> expired('00012+00012+02012')
15686
>>> expired('21 12 2012')
15695
>>> expired('26.03.2407')
159695

>>> mayadate('01/01/1970')
'12/17/16/7/5'
>>> mayadate('20-7-1988',separator='/')
'12/18/15/4/0'
>>> mayadate('00012+00012+02012',separator='-')
'12-19-19-17-11'
>>> mayadate('21 12 2012',separator='+')
'13+0+0+0+0'
>>> mayadate('26.03.2407')
'14.0.0.0.0'