Marie invented a Time Machine and wants to test it by time-traveling to visit Russia on the Day of the Programmer (the 256th day of the year) during a year in the inclusive range from 1700 to 2700. 

From 1700 to 1917, Russia's official calendar was the Julian calendar; since 1919 they used the Gregorian calendar system. The transition from the Julian to Gregorian calendar system occurred in 1918, when the next day after January 31st was February 14th. This means that in 1918, February 14th was the 32nd day of the year in Russia.

In both calendar systems, February is the only month with a variable amount of days; it has 29 days during a leap year, and 28 days during all other years. In the Julian calendar, leap years are divisible by 4; in the Gregorian calendar, leap years are either of the following:

Divisible by 400.
Divisible by 4 and not divisible by 100.

Given a year, $y$, find the date of the 256th day of that year according to the official Russian calendar during that year. Then print it in the format dd.mm.yyyy, where dd is the two-digit day, mm is the two-digit month, and yyyy is $y$.

For example, the given $year$ = 1984.  1984 is divisible by 4, so it is a leap year.  The 256th day of a leap year after 1918 is September 12, so the answer is $12.09.1984$.  

Function Description  

Complete the dayOfProgrammer function in the editor below.  It should return a string representing the date of the 256th day of the year given.  

dayOfProgrammer has the following parameter(s):  

year: an integer  

Input Format

A single integer denoting year $y$.

Constraints

1700 \le y \le 2700

Output Format

Print the full date of Day of the Programmer during year $y$ in the format dd.mm.yyyy, where dd is the two-digit day, mm is the two-digit month, and yyyy is $y$.

Sample Input 0
2017

Sample Output 0
13.09.2017

Explanation 0

In the year $y$ = 2017, January has 31 days, February has 28 days, March has 31 days, April has 30 days, May has 31 days, June has 30 days, July has 31 days, and August has 31 days. When we sum the total number of days in the first eight months, we get 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 = 243. Day of the Programmer is the 256th day, so then calculate 256 - 243 = 13 to determine that it falls on day 13 of the 9th month (September). We then print the full date in the specified format, which is 13.09.2017.

Sample Input 1
2016

Sample Output 1
12.09.2016

Explanation 1

Year $y$ = 2016 is a leap year, so February has 29 days but all the other months have the same number of days as in 2017. When we sum the total number of days in the first eight months, we get 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 = 244. Day of the Programmer is the 256th day, so then calculate 256 - 244 = 12 to determine that it falls on day 12 of the 9th month (September). We then print the full date in the specified format, which is 12.09.2016.

Sample Input 2
1800

Sample Output 2
12.09.1800

Explanation 2

Since 1800 is leap year as per Julian calendar. Day lies on 12 September.

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
y = int(input())
if y < 1918:
	ftext = '13.09.{}' if y & 3 else '12.09.{}'
elif y > 1918:
	ftext = '13.09.{}' if y & 3 or (y % 400 and (not y % 100)) else '12.09.{}'
else:
	ftext = '26.09.{}'
print(ftext.format(y))


import sys
y = int(input().strip())
if y < 1918:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y > 1918:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
else:
	print('26.09.1918')


import sys
y = int(input().strip())
first_eight_months = 243
if y > 1918:
	is_leap_year = y % 400 == 0 or (y % 4 == 0 and y % 100 != 0)
	total = first_eight_months
	if is_leap_year:
		total += 1
	diff = 256 - total
	print('{}.09.{}'.format(diff, y))
else:
	is_leap_year = y % 4 == 0
	total = first_eight_months
	if is_leap_year:
		total += 1
	if y == 1918:
		total -= 13
	diff = 256 - total
	print('{}.09.{}'.format(diff, y))


y = int(input().strip())
d = 13
if y % 4 == 0 and (y < 1918 or y % 400 == 0 or y % 100 != 0):
	d -= 1
if y == 1918:
	d += 13
print('%02d.09.%04d' % (d, y))


import sys
date_leap = '12.09.'
date_leap_p = '13.09.'
date_1918 = '26.09.1918'
y = int(input().strip())
if y < 1918:
	if y % 4 == 0:
		print(date_leap + str(y))
	else:
		print(date_leap_p + str(y))
elif y > 1918:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		print(date_leap + str(y))
	else:
		print(date_leap_p + str(y))
else:
	print(date_1918)


import sys
samedays = 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31
y = int(input().strip())
if y == 1918:
	print('{:02d}.{:02d}.{:04d}'.format(256 - samedays + 13, 9, y))
elif y < 1918:
	if y % 4 == 0:
		print('{:02d}.{:02d}.{:04d}'.format(256 - samedays - 1, 9, y))
	else:
		print('{:02d}.{:02d}.{:04d}'.format(256 - samedays, 9, y))
elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
	print('{:02d}.{:02d}.{:04d}'.format(256 - samedays - 1, 9, y))
else:
	print('{:02d}.{:02d}.{:04d}'.format(256 - samedays, 9, y))


import sys
y = int(input().strip())
if y % 4 == 0:
	if y < 1918:
		print('12.09.' + str(y))
	elif y % 400 == 0 or y % 100 != 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y == 1918:
	print('26.09.' + str(y))
else:
	print('13.09.' + str(y))


import sys
y = int(input().strip())
if y > 1918:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		print('12.09.', str(y), sep='')
	else:
		print('13.09.', str(y), sep='')
elif y < 1918:
	if y % 4 == 0:
		print('12.09.', str(y), sep='')
	else:
		print('13.09.', str(y), sep='')
else:
	print('26.09.', str(y), sep='')


import sys

def isLeapYear(y):
	if y <= 1917:
		return 0 == y % 4
	else:
		return 0 == y % 4 and 0 != y % 100 or 0 == y % 400
y = int(input().strip())
daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if y == 1918:
	daysInMonth[1] = 15
elif isLeapYear(y):
	daysInMonth[1] = 29
month = 0
daysLeft = 256
while daysLeft > daysInMonth[month]:
	daysLeft -= daysInMonth[month]
	month += 1
if y == 1918 and month == 1:
	daysLeft += 13
print('%02d.%02d.%d' % (daysLeft, month + 1, y))


import sys
y = int(input().strip())
days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if y == 1918:
	days[1] = 15
elif y < 1917:
	if y % 4 == 0:
		days[1] = 29
elif y % 4 == 0:
	days[1] = 29
	if y % 100 == 0:
		days[1] = 28
	if y % 400 == 0:
		days[1] = 29
m = 1
(td, d) = (0, 0)
while d == 0:
	if days[m - 1] < 256 - td:
		td += days[m - 1]
		m += 1
	else:
		d = 256 - td
print('{:02d}.{:02d}.{:4d}'.format(d, m, y))


import sys
months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
year = int(input().strip())
if year < 1918:
	leap_day = 0
	if year % 4 == 0:
		leap_day += 1
	cntr = 256
	cntr -= leap_day
	month = 1
	for days in months:
		if days > cntr:
			break
		cntr -= days
		month += 1
elif year > 1918:
	leap_day = 0
	if year % 400 == 0:
		leap_day += 1
	elif year % 4 == 0 and year % 100 != 0:
		leap_day += 1
	cntr = 256
	cntr -= leap_day
	month = 1
	for days in months:
		if days > cntr:
			break
		cntr -= days
		month += 1
else:
	cntr = 256 - 46
	month = 3
	for days in months[2:]:
		if days > cntr:
			break
		cntr -= days
		month += 1
print('{:02d}.{:02d}.{:04d}'.format(cntr, month, year))


import sys
y = int(input().strip())
if y > 1918 and y <= 2700:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y < 1918 and y >= 1700:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y == 1918:
	print('26.09.1918')


import sys
y = int(input().strip())
months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
current_month = 1
days = sum(months[:2])
if y <= 1918:
	if y == 1918:
		days -= 13
	if y % 4 == 0:
		days += 1
elif y % 400 == 0:
	days += 1
elif y % 4 == 0 and y % 100 != 0:
	days += 1
while days <= 256:
	current_month += 1
	days += months[current_month]
day = months[current_month] - (days - 256)
print('{0:02d}.{1:02d}.{2}'.format(day, current_month + 1, y))


import sys
y = int(input().strip())
calendar = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if y > 1918 and (y % 4 == 0 and y % 100 != 0 or y % 400 == 0):
	calendar[1] = 29
elif y < 1918 and y % 4 == 0:
	calendar[1] = 29
elif y == 1918:
	calendar[1] = 15
m = 1
d256 = 256
while d256 > 0:
	d256 -= calendar[m]
	if d256 > 0:
		m += 1
	else:
		print(str(calendar[m] + d256 - 1) + '.' + str(m).zfill(2) + '.' + str(y))


import sys

def is_gregorian_leap(year):
	if year % 400 == 0:
		return True
	if year % 4 == 0 and year % 100 != 0:
		return True
	return False

def is_julian_leap(year):
	if year % 4 == 0:
		return True
	return False

def programmer_day(year):
	if year >= 1919:
		if is_gregorian_leap(year):
			return '12.09.' + str(year)
		else:
			return '13.09.' + str(year)
	if year == 1918:
		return '26.09.1918'
	if is_julian_leap(year):
		return '12.09.' + str(year)
	return '13.09.' + str(year)
y = int(input().strip())
print(programmer_day(y))


import sys
y = int(input().strip())
if y < 1918 and y % 4 == 0:
	day = 256 - 244
elif y < 1918 and y % 4 != 0:
	day = 256 - 243
elif y > 1918 and (y % 400 == 0 or (y % 4 == 0 and y % 100 != 0)):
	day = 256 - 244
elif y > 1918 and y % 400 != 0:
	day = 256 - 243
elif y == 1918:
	day = 256 - (31 + 15 + 31 + 30 + 31 + 30 + 31 + 31)
print(str(day) + '.09.' + str(y))


import sys
y = int(input().strip())
count = 0
if y > 1918 and y <= 2700:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		count = 1
	if count == 1:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
if y < 1918 and y >= 1700:
	if y % 4 == 0:
		count = 1
	if count == 1:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
if y == 1918:
	print('26.09.1918')


import sys
y = int(input().strip())
if y < 1918:
	isJul = True
elif y == 1918:
	isJul = 'transYear'
else:
	isJul = False
if isJul == False and (y % 4 == 0 and y % 100 > 0 or y % 400 == 0):
	isLeap = True
elif isJul == True and y % 4 == 0:
	isLeap = True
else:
	isLeap = False
if isJul == 'transYear':
	d = 256 - 230
elif isLeap == False:
	d = 256 - 243
elif isLeap == True:
	d = 256 - 244
print(str(d) + '.09.' + str(y))


import sys

def solve(y):
	if y == 1918:
		return '26.09.1918'
	elif y < 1918 and y % 4 == 0 or (y > 1918 and (y % 400 == 0 or (y % 4 == 0 and y % 100 != 0))):
		return '12.09.' + str(y)
	else:
		return '13.09.' + str(y)
y = int(sys.stdin.readline())
print(solve(y))


import sys
y = int(input().strip())
if y == 1918:
	print('26.09.', y, sep='')
elif y < 1917 and y % 4 == 0 or (y > 1917 and (y % 400 == 0 or (y % 4 == 0 and y % 100 != 0))):
	print('12.09.', y, sep='')
else:
	print('13.09.', y, sep='')


import sys
yearlist = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
d = 256
y = int(input().strip())
if y < 1918:
	if y % 4 == 0:
		yearlist[1] += 1
elif y == 1918:
	yearlist[1] -= 13
elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
	yearlist[1] += 1
m = 1
while d > yearlist[m - 1]:
	d -= yearlist[m - 1]
	m += 1
print('{:02d}.{:02d}.{}'.format(d, m, y))


import sys
res_nonleap = '13.09.'
res_leap = '12.09.'
res_1918 = '26.09.1918'
y = int(input().strip())

def isleap(y):
	if y > 1918:
		return y % 400 == 0 or (y % 100 != 0 and y % 4 == 0)
	else:
		return y % 4 == 0
if y == 1918:
	print(res_1918)
elif isleap(y):
	print(res_leap + str(y))
else:
	print(res_nonleap + str(y))


year = int(input())
if year < 1918:
	if year % 4 == 0:
		print('12.09.' + str(year))
	else:
		print('13.09.' + str(year))
elif year == 1918:
	print('26.09.' + str(year))
elif year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
	print('12.09.' + str(year))
else:
	print('13.09.' + str(year))


import sys
y = int(input().strip())
if y < 1700 or y > 2700:
	print('Not within range')
	exit()
if y == 1918:
	print('26.09.' + str(y))
	exit()
if y >= 1700 and y < 1919:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
if y > 1918:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))


monthLengths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
year = int(input().strip())
if year < 1918:
	if year % 4 == 0:
		monthLengths[1] = 29
elif year == 1918:
	monthLengths[1] = 15
elif year > 1918:
	if year % 100 == 0:
		if year % 400 == 0:
			monthLengths[1] = 29
	elif year % 4 == 0:
		monthLengths[1] = 29
currMonth = 0
daysLeft = 256
while daysLeft > monthLengths[currMonth]:
	daysLeft -= monthLengths[currMonth]
	currMonth += 1
daysString = str(daysLeft)
if len(daysString) == 1:
	daysString = '0' + daysString
monthsString = str(currMonth + 1)
if len(monthsString) == 1:
	monthsString = '0' + monthsString
yearsString = str(year)
print(daysString + '.' + monthsString + '.' + yearsString)


import sys

def is_leap(year):
	if year <= 1918:
		return year % 4 == 0
	else:
		return year % 400 == 0 or (year % 4 == 0 and year % 100 != 0)

def solve(year):
	if year == 1918:
		return '26.09.1918'
	elif is_leap(year):
		return '12.09.{}'.format(year)
	else:
		return '13.09.{}'.format(year)
y = int(input().strip())
print(solve(y))


import sys
y = int(input().strip())
if 1700 <= y <= 1917:
	print(('12.09.%d' if y % 4 == 0 else '13.09.%d') % y)
elif y == 1918:
	print('26.09.1918')
else:
	print(('12.09.%d' if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0) else '13.09.%d') % y)


import sys
days = [31, 28, 31, 30, 31, 30, 31, 31]
y = int(input().strip())
if y < 1918:
	days_09 = sum(days)
	if y % 4 == 0:
		days_09 += 1
elif y == 1918:
	days_09 = 230
elif y > 1918:
	days_09 = sum(days)
	if y % 400 == 0:
		days_09 += 1
	elif y % 4 == 0 and (not y % 100 == 0):
		days_09 += 1
day = 256 - days_09
print('{}.09.{}'.format(day, y))


import sys
y = int(input().strip())
if y > 1918:
	if y % 400 == 0:
		str1 = '12.09.' + str(y)
		print(str1)
	elif y % 4 == 0 and y % 100 != 0:
		str1 = '12.09.' + str(y)
		print(str1)
	else:
		str1 = '13.09.' + str(y)
		print(str1)
elif y < 1918:
	if y % 4 == 0:
		str1 = '12.09.' + str(y)
		print(str1)
	else:
		str1 = '13.09.' + str(y)
		print(str1)
else:
	print('26.09.1918')


import sys
y = int(input().strip())
if (y < 1700) | (y > 2700):
	print('Wrong input!')
elif y == 1918:
	print('26.09.' + str(y))
elif y < 1918:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y > 1918:
	if y % 400 == 0:
		print('12.09.' + str(y))
	elif (y % 4 == 0) & (y % 100 != 0):
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))


import sys

def leapg(yy):
	if yy / 400 == int(yy / 400):
		return 1
	elif yy / 4 == int(yy / 4) and yy / 100 != int(yy / 100):
		return 1
	else:
		return 0

def leapj(yy):
	if yy / 4 == int(yy / 4):
		return 1
	else:
		return 0
y = int(input().strip())
sy = str(y)
if y < 1918:
	if leapj(y) == 1:
		print('12.09.' + sy)
	else:
		print('13.09.' + sy)
elif y == 1918:
	print('26.09.1918')
elif y > 1918:
	if leapg(y) == 1:
		print('12.09.' + sy)
	else:
		print('13.09.' + sy)


y = int(input())
if y <= 1917:
	leap = y % 4 == 0
	print(['13.09.{:d}', '12.09.{:d}'][leap].format(y))
elif y >= 1919:
	leap = y % 400 == 0 or (y % 4 == 0 and y % 100 != 0)
	print(['13.09.{:d}', '12.09.{:d}'][leap].format(y))
else:
	print('26.09.1918')


year = int(input().strip())
if 1700 <= year <= 1917:
	if year % 4 == 0:
		print('{}.09.{}'.format(256 - 244, year))
	else:
		print('{}.09.{}'.format(256 - 243, year))
elif year == 1918:
	print('{}.09.{}'.format(256 - 230, year))
elif 1919 <= year <= 2700:
	if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
		print('{}.09.{}'.format(256 - 244, year))
	else:
		print('{}.09.{}'.format(256 - 243, year))


import sys
feb = 28
y = int(input().strip())
if y >= 1700 and y <= 1917:
	if y % 4 == 0:
		feb = 29
elif y >= 1919 and y <= 2700:
	if y % 4 == 0 and y % 100 != 0 or y % 400 == 0:
		feb = 29
else:
	feb = 15
if feb == 29:
	print('12.09.' + str(y))
elif feb == 28:
	print('13.09.' + str(y))
else:
	print('26.09.' + str(y))


import sys
y = int(input().strip())
if y > 1918:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y < 1918:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
else:
	print('26.09.' + str(y))


y = int(input())
if y >= 1700 and y <= 1917:
	if y % 4 == 0:
		print('12.09', end='.')
		print(y)
	else:
		print('13.09', end='.')
		print(y)
if y >= 1919 and y <= 2700:
	if y % 4 == 0 and y % 100 != 0 or y % 400 == 0:
		print('12.09', end='.')
		print(y)
	else:
		print('13.09', end='.')
		print(y)
if y == 1918:
	print('26.09', end='.')
	print(y)


import sys
year = int(input().strip())
if year == 1918:
	print('26.09.%d' % year)
elif year < 1918:
	if year % 4 == 0:
		print('12.09.%d' % year)
	else:
		print('13.09.%d' % year)
elif year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
	print('12.09.%d' % year)
else:
	print('13.09.%d' % year)


import sys
y = int(input().strip())
months = [31, -1, 31, 30, 31, 30, 31, 31]
feb = 28
if y > 1918:
	if y % 4 == 0 and y % 100 > 0 or y % 400 == 0:
		feb = 29
elif y == 1918:
	feb = 28 - 13
elif y % 4 == 0:
	feb = 29
months[1] = feb
d = 256
for m in months:
	d -= m
print('%d.09.%d' % (d, y))


import sys
y = int(input().strip())
if y == 1918:
	date = '26.09.1918'
	print(date)
	exit()
if y > 1918:
	if y % 400 == 0 or (y % 4 == 0 and (not y % 100 == 0)):
		date = '12.09.' + str(y)
		print(date)
	else:
		date = '13.09.' + str(y)
		print(date)
elif y % 4 == 0:
	date = '12.09.' + str(y)
	print(date)
else:
	date = '13.09.' + str(y)
	print(date)


import sys
y = int(input().strip())
if y == 1918:
	print('26.09.' + str(y))
elif y < 1918:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y % 400 == 0 or (y % 100 != 0 and y % 4 == 0):
	print('12.09.' + str(y))
else:
	print('13.09.' + str(y))


import sys

def is_leap(y):
	if y < 1918:
		return y % 4 == 0
	else:
		return y % 4 == 0 and y % 100 != 0 or y % 400 == 0
year = int(input().strip())
if year != 1918:
	if is_leap(year):
		print('12.09.' + str(year))
	else:
		print('13.09.' + str(year))
else:
	print('26.09.1918')


import sys
y = int(input().strip())
if y < 1918:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y > 1918:
	if y % 400 == 0:
		print('12.09.' + str(y))
	elif y % 4 == 0 and y % 100 != 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y == 1918:
	print('26.09.' + str(y))


import sys
y = int(input().strip())
if y >= 1919:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y == 1918:
	print('26.09.' + str(y))
elif y % 4 == 0:
	print('12.09.' + str(y))
else:
	print('13.09.' + str(y))


import sys

def solve(year):
	if year < 1918:
		if leap_jul(year):
			print(leap_sol.format(year))
		else:
			print(non_sol.format(year))
	elif year > 1918:
		if leap_greg(year):
			print(leap_sol.format(year))
		else:
			print(non_sol.format(year))
	else:
		print(special_sol.format(year))

def leap_jul(year):
	return year % 4 == 0

def leap_greg(year):
	if year % 400 == 0:
		return True
	else:
		return year % 4 == 0 and year % 100 != 0
leap_sol = '12.09.{}'
non_sol = '13.09.{}'
special_sol = '26.09.{}'
year = int(input().strip())
solve(year)


import sys
year = int(input().strip())
day = 13
month = 9
if year % 4 == 0:
	day -= 1
	if year > 1918 and year % 100 == 0 and (year % 400 != 0):
		day += 1
if year == 1918:
	day = 26
date = [str(x) for x in [day, month, year]]
for i in [0, 1]:
	while len(date[i]) < 2:
		date[i] = '0' + date[i]
print('.'.join(date))


year = int(input().strip())
if year < 1918:
	if year % 4 == 0:
		feb = 29
		progday = '12.09'
	else:
		feb = 28
		progday = '13.09'
elif year == 1918:
	print('26.09.1918')
	exit(0)
elif year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
	progday = '12.09'
else:
	progday = '13.09'
answer = progday + '.' + str(year)
print(answer)


def date(y):
	if y < 1918:
		if y % 4:
			d = 13
		else:
			d = 12
	elif y == 1918:
		d = 26
	elif y % 100 and (not y % 4) or not y % 400:
		d = 12
	else:
		d = 13
	return '%02d.09.%d' % (d, y)
y = int(input().strip())
print(date(y))


import sys

def calendar_type(year):
	if year < 1918:
		return 'julian'
	elif year > 1918:
		return 'gregorian'
	else:
		return 'transition'

def is_leaper(year, calendar):
	if calendar == 'julian' and year % 4 == 0:
		return True
	elif calendar == 'gregorian' and (y % 4 == 0 and y % 100 != 0 or y % 400 == 0):
		return True
	else:
		return False

def feb_length(year, leaper):
	if year == 1918:
		return 15
	elif leaper:
		return 29
	else:
		return 28

def find_date(year, feb_length):
	days_first_months = 215 + feb_length
	day = 256 - days_first_months
	return str(day) + '.09.' + str(year)
y = int(input().strip())
calendar = calendar_type(y)
leaper = is_leaper(y, calendar)
feb = feb_length(y, leaper)
date = find_date(y, feb)
print(date)


import sys
y = int(input().strip())
d = 13
if y < 1918:
	if y % 4 == 0:
		d = 12
elif y == 1918:
	d = 26
elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
	d = 12
print('%d.09.%d' % (d, y))


import sys
y = int(input().strip())
if y >= 1918:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		LeapYear = True
	else:
		LeapYear = False
elif y % 4 == 0:
	LeapYear = True
else:
	LeapYear = False
if y == 1918:
	print('26.09.1918')
elif LeapYear == True:
	ausgabe = str(y)
	print('12.09.' + ausgabe)
else:
	ausgabe = str(y)
	print('13.09.' + ausgabe)


y = int(input().rstrip())
if 1700 <= y <= 1917:
	if y % 4:
		print('13.09.' + str(y))
	else:
		print('12.09.' + str(y))
elif y == 1918:
	print('26.09.1918')
elif 1919 <= y <= 2700:
	if not y % 400 or (not y % 4 and y % 100):
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))


import sys
y = int(input().strip())
if y < 1918:
	if y % 4 == 0:
		print('12.09.%d' % y)
	else:
		print('13.09.%d' % y)
elif y > 1918:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		print('12.09.%d' % y)
	else:
		print('13.09.%d' % y)
else:
	print('26.09.%d' % y)


import sys
y = int(input().strip())
leap = 12
nleap = 13
if y == 1918:
	print('26.09.1918')
elif y < 1918:
	if y % 4 == 0:
		print('12.09.%d' % y)
	else:
		print('13.09.%d' % y)
elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
	print('%d.09.%d' % (leap, y))
else:
	print('%d.09.%d' % (nleap, y))


import sys

def solve(x):
	if x >= 1919:
		if x % 4 == 0 and x % 100 != 0 or x % 400 == 0:
			return '12.09.{0}'.format(x)
		else:
			return '13.09.{0}'.format(x)
	if x == 1918:
		return '26.09.1918'
	if x % 4 == 0:
		return '12.09.{0}'.format(x)
	else:
		return '13.09.{0}'.format(x)

def main(inp=sys.stdin):
	n = int(inp.readline().strip())
	print(solve(n))
main()


import sys
y = int(input().strip())

def isLeapYear(y, system):
	if system == 'G':
		if y % 400 == 0:
			return True
		if y % 100 == 0:
			return False
		if y % 4 == 0:
			return True
		else:
			return False
	if system == 'J':
		if y % 4 == 0:
			return True

def generateMonths(year):
	mode = 'G'
	months = [31]
	if year < 1918:
		mode = 'J'
	if isLeapYear(year, mode):
		months.append(29)
	else:
		months.append(28)
	x = 2
	while x in range(2, 13):
		if x % 2 == 0:
			months.append(31)
		elif x % 7 == 0:
			months.append(31)
			x += 1
		else:
			months.append(30)
		x += 1
	return months

def getDayOfTheProgrammer(year):
	monthsHeaders = ['January', 'Febuary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'Novemver', 'December']
	months = generateMonths(year)
	days = []
	for x in range(len(monthsHeaders)):
		for y in range(1, months[x] + 1):
			days.append([monthsHeaders[x], y])
	if year == 1918:
		for x in range(1, 14):
			del days[31]
	count = 0
	remained = 0
	day = days[256 - 1]
	return [day[1], monthsHeaders.index(day[0]) + 1, year]
day = tuple(getDayOfTheProgrammer(y))
print('{0:02d}.{1:02d}.{2:04d}'.format(day[0], day[1], day[2]))


import sys

def days_in_month(is_leap):
	return {1: 31, 2: 29 if is_leap else 28, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}

def solve(is_leap, year):
	day = 256
	m = 1
	while day > days_in_month(is_leap)[m]:
		day -= days_in_month(is_leap)[m]
		m += 1
	month_leading_z = '0' + str(m) if m < 10 else str(m)
	print(str(day) + '.' + month_leading_z + '.' + str(year))

def solve_julian(year):
	is_leap = year % 4 == 0
	solve(is_leap, year)

def solve_gregorian(year):
	is_leap = year % 400 == 0 or (year % 4 == 0 and year % 100 != 0)
	solve(is_leap, year)

def solve_transition(year):
	print('26.09.1918')
y = int(input().strip())
if y < 1918:
	solve_julian(y)
if y > 1918:
	solve_gregorian(y)
if y == 1918:
	solve_transition(y)


import sys

def is_leap(y):
	is_julian = y < 1919
	if is_julian:
		return y % 4 == 0
	return y % 4 == 0 and y % 100 != 0 or y % 400 == 0
y = int(input().strip())
is_leap = is_leap(y)
day = 0
if is_leap:
	day = 12
else:
	day = 13
if y == 1918:
	day += 13
print(str(day) + '.09.' + str(y))


import sys
days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
leapdays = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
ndays = [31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
y = int(input().strip())

def leap(y):
	day = 256
	m = 0
	for i in leapdays:
		day -= i
		if day < 0:
			break
		m += 1
	if day < 0:
		day += leapdays[m]
	m = str(m + 1).zfill(2)
	print(str(day) + '.' + m + '.' + str(y))

def notleap(y):
	day = 256
	m = 0
	for i in days:
		day -= i
		if day < 0:
			break
		m += 1
	if day < 0:
		day += days[m]
	m = str(m + 1).zfill(2)
	print(str(day) + '.' + m + '.' + str(y))
if 1700 <= y <= 1917:
	if y % 4 == 0:
		leap(y)
	else:
		notleap(y)
elif y > 1918:
	if y % 100 == 0:
		if y % 400 == 0:
			leap(y)
		else:
			notleap(y)
	elif y % 4 == 0:
		leap(y)
	else:
		notleap(y)
else:
	day = 210
	m = 0
	for i in ndays:
		day -= i
		if day < 0:
			break
		m += 1
	if day < 0:
		day += ndays[m]
	m = str(m + 3).zfill(2)
	print(str(day) + '.' + m + '.' + str(y))


import sys
y = int(input().strip())
days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if y == 1918:
	print('26.09.1918')
else:
	days = 0
	month = 0
	while days < 256:
		if month == 1:
			if y < 1918 and y % 4 == 0 or (y > 1918 and (y % 400 == 0 or (y % 4 == 0 and y % 100 != 0))):
				days += 29
				month += 1
				continue
		days += days_in_month[month]
		month += 1
	date = 256 - (days - days_in_month[month - 1])
	month = '0' + str(month) if month < 10 else month
	print(str(date) + '.' + str(month) + '.' + str(y))


import sys
y = int(input().strip())
if y < 1918:
	if y % 4 == 0:
		day256 = '12.09.{0}'.format(y)
	else:
		day256 = '13.09.{0}'.format(y)
elif y == 1918:
	day256 = '26.09.{0}'.format(y)
elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
	day256 = '12.09.{0}'.format(y)
else:
	day256 = '13.09.{0}'.format(y)
print(day256)


import sys
y = int(input().strip())
p = '12.09.'
n = '13.09.'
if y < 1918:
	if y % 4 == 0:
		print(p + str(y))
	else:
		print(n + str(y))
elif y > 1918:
	if y % 4 == 0:
		if y % 100 == 0:
			if y % 400 == 0:
				print(p + str(y))
			else:
				print(n + str(y))
		else:
			print(p + str(y))
	else:
		print(n + str(y))
else:
	print('26.09.1918')


import sys

def isJulLeap(y):
	if y % 4 == 0:
		return True
	else:
		return False

def isGrigLeap(y):
	if y % 400 == 0:
		return True
	elif y % 4 == 0 and y % 100 != 0:
		return True
	else:
		return False
days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
y = int(input().strip())
if y < 1918:
	if isJulLeap(y):
		print('.'.join(['12', '09', str(y)]))
	else:
		print('.'.join(['13', '09', str(y)]))
elif y == 1918:
	print('.'.join(['26', '09', str(y)]))
elif isGrigLeap(y):
	print('.'.join(['12', '09', str(y)]))
else:
	print('.'.join(['13', '09', str(y)]))


import sys
y = int(input().strip())
if y >= 1700 and y <= 1917:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y >= 1919 and y <= 2700:
	if y % 400 == 0:
		print('12.09.' + str(y))
	elif y % 4 == 0 and y % 100 != 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y == 1918:
	print('26.09.' + str(y))


s = int(input().strip())
if s <= 1917:
	if s % 4 == 0:
		print('12', '09', s, sep='.')
	else:
		print('13', '09', s, sep='.')
elif s >= 1919:
	if s % 4 == 0 and s % 100 != 0 or s % 400 == 0:
		print('12', '09', s, sep='.')
	else:
		print('13', '09', s, sep='.')
else:
	print('26', '09', s, sep='.')


import sys
y = int(input().strip())
leap = 0
if y == 1918:
	leap = 13
leap -= int(y % 4 == 0)
if y >= 1918:
	leap += int(y % 100 == 0)
	leap -= int(y % 400 == 0)
print('{0}.09.{1}'.format(13 + leap, y))


import sys
NON_LEAP_YEAR_DATE = 13
NON_LEAP_YEAR_MONTH = '09'
WEIRD_DATE = 26
WEIRD_MONTH = '09'

def whatCalendar(y):
	if 1700 <= y <= 1917:
		return 'Julian'
	elif 1919 <= y <= 2700:
		return 'Gregorian'
	elif y == 1918:
		return 'Weird'
	else:
		return 'Invalid year!'

def JulianLeapYear(y):
	if y % 4 == 0:
		return 1
	return 0

def GregorianLeapYear(y):
	if y % 400 == 0:
		return 1
	elif y % 4 == 0 and y % 100 != 0:
		return 1
	return 0

def whatDayIsIt(y):
	yr = whatCalendar(y)
	lp = 0
	if yr != 'Weird':
		if yr == 'Gregorian':
			lp = GregorianLeapYear(y)
		elif yr == 'Julian':
			lp = JulianLeapYear(y)
		date = NON_LEAP_YEAR_DATE - lp
		return str(date) + '.' + NON_LEAP_YEAR_MONTH + '.' + str(y)
	elif yr == 'Weird':
		return str(WEIRD_DATE) + '.' + WEIRD_MONTH + '.' + str(y)
	else:
		return 'Error!'
y = int(input().strip())
print(whatDayIsIt(int(y)))


import sys
y = int(input().strip())
if y <= 1917:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y == 1918:
	print('26' + '.' + '09' + '.' + '1918')
elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
	print('12.09.' + str(y))
else:
	print('13.09.' + str(y))


import sys
y = int(input().strip())
if y < 1918:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y > 1918:
	if y % 400 == 0:
		print('12.09.' + str(y))
	elif y % 4 == 0 and y % 100 != 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
else:
	print('26.09.1918')


def isleap(y):
	if y < 1919:
		return y % 4 == 0
	if y % 400 == 0:
		return True
	return y % 4 == 0 and y % 100 != 0
year = int(input())
months = {1: 31, 2: 29 if isleap(year) else 28, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}
days_remaining = 256
month = 1
if year == 1918:
	days_remaining -= 31 + 28 - 13
	month = 3
while days_remaining > 0:
	days_remaining -= months[month]
	month += 1
month -= 1
day = months[month] + days_remaining
print('{:02d}.{:02d}.{}'.format(day, month, year))


import sys
y = int(input().strip())
month = list(map(int, [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]))
if y < 1918:
	if y % 4 == 0:
		month[1] = 29
elif y == 1918:
	month[1] = 15
elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
	month[1] = 29
sumo = 0
day = 0
mon = 0
stop = 0
for x in range(0, 11):
	sumo = sumo + month[x]
	if sumo > 256 and stop == 0:
		sumo = sumo - month[x]
		day = 256 - sumo
		mon = x + 1
		print(day, format(mon, '02d'), y, sep='.')
		stop = 1


import sys
y = int(input().strip())
from datetime import date, timedelta

def format_date(d):
	return d.strftime('%d.%m.%Y')

def greg_day(year):
	jan_1 = date(year, 1, 1)
	return format_date(jan_1 + timedelta(days=255))

def solution(year):
	if year == 1918:
		feb_14 = date(1918, 2, 14)
		return format_date(feb_14 + timedelta(days=256 - 32))
	elif year < 1918:
		if year % 4 == 0:
			return format_date(date(year, 9, 12))
		else:
			return '13.09.{}'.format(year)
	else:
		return greg_day(year)
print(solution(y))


import sys
y = int(input().strip())
if y > 1919:
	if y % 4 != 0 or (y % 100 == 0 and y % 400 != 0):
		print('13.09.' + str(y))
	else:
		print('12.09.' + str(y))
elif y == 1918:
	print('26.09.' + str(y))
elif y % 4 != 0:
	print('13.09.' + str(y))
else:
	print('12.09.' + str(y))


import sys
y = int(input().strip())
if y < 1918:
	if y % 4 == 0:
		dt = '12.09.%s' % y
	else:
		dt = '13.09.%s' % y
elif y > 1918:
	if y % 4 == 0 and y % 100 != 0 or y % 400 == 0:
		dt = '12.09.%s' % y
	else:
		dt = '13.09.%s' % y
else:
	dt = '26.09.%s' % y
print(dt)


y = int(input())
if y < 1918:
	if y % 4 == 0:
		d = 12
	else:
		d = 13
elif y == 1918:
	d = 26
elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
	d = 12
else:
	d = 13
print('{}.09.{}'.format(d, y))


import sys
y = int(input().strip())
if y > 1918:
	if y % 4 == 0 and y % 100 != 0 or y % 400 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y < 1918:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
else:
	print('26.09.' + str(y))


import sys
y = int(input().strip())
months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
leapYear = y % 4 == 0
if 1919 <= y:
	leapYear = leapYear and (y % 100 != 0 or y % 400 == 0)
if leapYear:
	months[1] = 29
goal = 256
if y == 1918:
	goal += 13
month = 0
day = 0
for (m, days) in enumerate(months):
	if goal < days:
		month = m + 1
		day = goal
		break
	else:
		goal -= days
print('%02d.%02d.%4d' % (day, month, y))


y = int(input().strip())

def leap_year(year):
	if y < 1918:
		if y % 4 == 0:
			return True
		else:
			return False
	if y > 1918:
		if y % 400 == 0:
			return True
		elif y % 4 == 0 and y % 100 != 0:
			return True
		else:
			return False
if y == 1918:
	print('26.09.1918')
elif leap_year(y):
	print('12.09.{}'.format(y))
else:
	print('13.09.{}'.format(y))


import sys
y = int(input().strip())
if y <= 1917:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y == 1918:
	print('26.09.1918')
elif y % 400 == 0 or (y % 100 != 0 and y % 4 == 0):
	print('12.09.' + str(y))
else:
	print('13.09.' + str(y))


import sys
y = int(input().strip())
months = [31, -1, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if y <= 1917:
	if y % 4 == 0:
		months[1] = 29
	else:
		months[1] = 28
elif y == 1918:
	months[1] = 15
elif y % 400 == 0:
	months[1] = 29
elif y % 100 != 0 and y % 4 == 0:
	months[1] = 29
else:
	months[1] = 28
count = 0
for i in range(len(months)):
	for j in range(1, months[i] + 1):
		count += 1
		if count == 256:
			if j + 1 < 10:
				j = '0' + str(j + 1)
			if i + 1 < 10:
				i = '0' + str(i + 1)
			print('{0}.{1}.{2}'.format(j, i, y))


y = int(input().strip())
if y < 1918:
	if y % 4 == 0:
		print('12.09', y, sep='.')
	else:
		print('13.09', y, sep='.')
elif y > 1918:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		print('12.09', y, sep='.')
	else:
		print('13.09', y, sep='.')
else:
	print('26.09.1918')


dd = '12'
mm = '09'
y = int(input())
if y <= 1917:
	if y % 4 == 0:
		print('12.09.', y, sep='')
	else:
		print('13.09.', y, sep='')
elif y > 1918:
	if (y % 4 == 0 and y % 100) != 0 or y % 400 == 0:
		print('12.09.', y, sep='')
	else:
		print('13.09.', y, sep='')
elif y == 1918:
	print('26.09.1918')


import sys
y = int(input().strip())
days_in_month = [31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if y < 1918:
	if y % 4 == 0:
		days_in_month[1] = 29
	else:
		days_in_month[1] = 28
if y > 1918:
	if y % 400 == 0:
		days_in_month[1] = 29
	elif y % 100 == 0:
		days_in_month[1] = 28
	elif y % 4 == 0:
		days_in_month[1] = 29
	else:
		days_in_month[1] = 28
if y == 1918:
	days_in_month[1] = 15
t = 256
month = 0
while t > days_in_month[month]:
	t -= days_in_month[month]
	month += 1
print('%02d.%02d.%4d' % (t, month + 1, y))


y = int(input())
if y > 1918:
	if y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y < 1918:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y == 1918:
	print('26.09.1918')


import sys
y = int(input().strip())
leap = y % 4 == 0 and (y % 100 != 0 or y % 400 == 0 if y > 1918 else True)
if y == 1918:
	print('26.09.' + str(y))
elif leap:
	print('12.09.' + str(y))
else:
	print('13.09.' + str(y))


import sys

def is_leap(y):
	if y < 1918:
		if y % 4 == 0:
			return True
		else:
			return False
	elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
		return True
	else:
		return False
y = int(input().strip())
N = 256
if y == 1918:
	print('26.09.1918')
elif is_leap(y):
	print('12.09.' + str(y))
else:
	print('13.09.' + str(y))


import sys
y = int(input().strip())
if y < 1918:
	if y % 4 == 0:
		answer = '12'
	else:
		answer = '13'
elif y == 1918:
	answer = '26'
elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
	answer = '12'
else:
	answer = '13'
answer += '.09.' + str(y)
print(answer)


y = int(input())
if y < 1918:
	d = 13 - int(y % 4 == 0)
elif y == 1918:
	d = 26
else:
	d = 13 - int(y % 400 == 0 or (y % 4 == 0 and y % 100 != 0))
print('.09.'.join(map(str, [d, y])))


import sys
s1 = '13.09.'
s2 = '12.09.'
s3 = '26.09.'
y = int(input().strip())
if y <= 1917:
	if y % 4 == 0:
		print(s2 + str(y))
	else:
		print(s1 + str(y))
elif y == 1918:
	print(s3 + str(y))
elif y % 4 == 0 and y % 100 != 0 or y % 400 == 0:
	print(s2 + str(y))
else:
	print(s1 + str(y))


y = int(input())
if y > 1918:
	if y % 4 == 0 and y % 100 != 0 or y % 400 == 0:
		print('12.09.', y, sep='')
	else:
		print('13.09.', y, sep='')
elif y < 1918:
	if y % 4 == 0:
		print('12.09.', y, sep='')
	else:
		print('13.09.', y, sep='')
else:
	print('26.09.1918')


import sys
y = int(input().strip())
if y == 1918:
	print('26.09.1918')
elif y <= 1917:
	if y % 4 == 0:
		ans = '12.09.' + str(y)
		print(ans)
	else:
		ans = '13.09.' + str(y)
		print(ans)
elif y % 400 == 0 or (y % 4 == 0 and (not y % 100 == 0)):
	ans = '12.09.' + str(y)
	print(ans)
else:
	ans = '13.09.' + str(y)
	print(ans)


import sys
y = int(input().strip())
noleapd = 13
leapd = 12
n18 = 26
if y > 1918:
	if (y % 100 != 0) & (y % 4 == 0) | (y % 400 == 0):
		print(str(leapd) + '.09.' + str(y))
	else:
		print(str(noleapd) + '.09.' + str(y))
elif y < 1918:
	if y % 4 == 0:
		print(str(leapd) + '.09.' + str(y))
	else:
		print(str(noleapd) + '.09.' + str(y))
else:
	print('26.09.' + str(y))


def getProgrammersDay(year):
	daysOfTheMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	daysOfTheMonthLeap = [x for x in daysOfTheMonth]
	daysOfTheMonthLeap[1] = 29
	daysOfTheMonth18 = [x for x in daysOfTheMonth]
	daysOfTheMonth18[1] = 28 - 13
	setToUse = []
	if year == 1918:
		setToUse = daysOfTheMonth18
	elif year < 1918:
		if year % 4 == 0:
			setToUse = daysOfTheMonthLeap
		else:
			setToUse = daysOfTheMonth
	elif year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
		setToUse = daysOfTheMonthLeap
	else:
		setToUse = daysOfTheMonth
	day = 256
	month = -1
	remaining = -1
	for m in range(12):
		if day - setToUse[m] > 0:
			day -= setToUse[m]
		else:
			month = m
			remaining = day
			break
	return (month + 1, remaining)
year = int(input())
(month, day) = getProgrammersDay(year)
print('{0:02d}.{1:02d}.{2}'.format(day, month, year))


import sys

def is_leap(year):
	return True if year % 400 == 0 or (year % 100 != 0 and year % 4 == 0) else False
y = int(input().strip())
if 1700 <= y <= 1917:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y == 1918:
	print('26.09.' + str(y))
elif y <= 2700:
	if is_leap(y):
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))


def days_upto_aug_except_feb():
	return 31 + 31 + 30 + 31 + 30 + 31 + 31

def day_of_the_programmer(year):
	days = 0
	if is_julian(year):
		if is_leap_year_in_julian(year):
			days = days_upto_aug_except_feb() + 29
		else:
			days = days_upto_aug_except_feb() + 28
	elif year == 1918:
		days = days_upto_aug_except_feb() + 28 - 13
	elif is_leap_year_in_gregorian(year):
		days = days_upto_aug_except_feb() + 29
	else:
		days = days_upto_aug_except_feb() + 28
	date = 256 - days
	return '%s.09.%s' % (date, year)

def is_leap_year_in_julian(year):
	return year % 4 == 0

def is_leap_year_in_gregorian(year):
	if year % 400 == 0:
		return True
	elif year % 4 == 0 and year % 100 != 0:
		return True
	return False

def is_julian(year):
	return year < 1918
print(day_of_the_programmer(int(input().strip())))


import sys
y = int(input().strip())
if y >= 1700 and y <= 1917:
	if y % 4 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
elif y >= 1919 and y <= 2700:
	if y % 4 == 0 and y % 100 != 0:
		print('12.09.' + str(y))
	elif y % 4 == 0 and y % 400 == 0:
		print('12.09.' + str(y))
	else:
		print('13.09.' + str(y))
else:
	print('26.09.' + str(y))


D = [0, 31, 28, 31, 30, 31, 30, 31, 31]
yyyy = int(input().strip())
if yyyy < 1918:
	if yyyy % 4 == 0:
		D[2] = 29
elif yyyy == 1918:
	D[2] = 15
elif yyyy % 400 == 0 or (yyyy % 4 == 0 and yyyy % 100 != 0):
	D[2] = 29
dd = str(256 - sum(D))
print(dd + '.09.' + str(yyyy))


import sys
G = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
T = [31, 15, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
i = 0
y = int(input().strip())
lp = 0
if y < 1918:
	lp = 1 if y % 4 == 0 else 0
else:
	lp = 1 if y % 4 == 0 and y % 100 != 0 or y % 400 == 0 else 0
P = T if y == 1918 else G
P[1] += lp
d = 0
while P[i] + d < 256:
	d += P[i]
	i += 1
d = str(256 - d).zfill(2)
m = str(i + 1).zfill(2)
y = str(y)
print(d + '.' + m + '.' + y)


import sys
y = int(input().strip())
if y != 1918:
	isLeap = y >= 1919 and (y % 400 == 0 or (y % 4 == 0 and y % 100 != 0)) or (y <= 1917 and y % 4 == 0)
	print('12.09.' + str(y) if isLeap else '13.09.' + str(y))
else:
	print('26.09.1918')


import sys
y = int(input().strip())
d = 13
if y >= 1700 and y <= 1917:
	if y % 4 == 0:
		d -= 1
elif y == 1918:
	d += 13
elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
	d -= 1
print(str(d) + '.09.' + str(y))


import sys
y = int(input().strip())
y1 = str(y)
if y <= 1917:
	if y % 4 == 0:
		print('12.09.' + y1)
	else:
		print('13.09.' + y1)
elif y == 1918:
	print('26.09.' + y1)
elif y % 400 == 0 or (y % 4 == 0 and y % 100 != 0):
	print('12.09.' + y1)
else:
	print('13.09.' + y1)