Age of Retirement
In some country it is decided to start raising the retirement age since January 1^st 2012. Prior to that date, the retirement age was 60 years.
The raising of the retirement age is carried out as follows. The increase is repeated K times in total. Each time, the retirement age is increased by M months. The first increase occurs on January 1^st 2012, and each of the next (K-1) increases happens N months after the previous increase (N > M). For example, let M=3. Then citizens born on December 31^st 1951 will retire on December 31^st 2011; and citizens born on January 1^st 1952 will retire on April 1^st 2012.
The date of retirement for a particular person is the minimum possible date on which that person's age is not less than the retirement age approved on that date.
To determine when a citizen turns I years and J months, you need to add I years and J months to the date of his birth, leaving the day of the month the same. In case there is no such day in the calendar, the required date is the first day of the next month. Thus, given that M=3 and N=5 those born on January 31^st 1952 will retire on May 1^st 2012 as well as those born on February 1^st 1952.
It is required to determine the date of citizen retirement given the date of his birth. It is considered that life expectancy can be arbitrarily large.
A year is leap if the number of the year is divisible by 400 or it is divisible by 4 but is not divisible by 100.
Input
Three integers M, N and K (0 < M ≤ 12, M < N ≤ 24, 0 ≤ K ≤ 60) are given on the first line of input. The second line of input contains a citizen birth date in the format "DD.MM.YYYY" (that is, day, month and year without the quotes and with leading zero for numbers below 10).
All dates are between 01.01.1900 and 31.12.2100.
Output
Print the date of retirement for the given citizen in the same format as input date.