#!/bin/python3

import math
import os
import random
import re
import sys

#
# Complete the 'dayOfProgrammer' function below.
#
# The function is expected to return a STRING.
# The function accepts INTEGER year as parameter.
#

def dayOfProgrammer(year):
    noDays = 256
    if (year < 1918):
        feb = 0
        #Julian
        if ((year % 4) == 0):
            #Leap year
            feb = 29
        else:
            #Not leap year
            feb = 28
        date = (noDays - (31+feb+31+30+31+30+31+31))
        answer = str(date)+".09."+str(year)
    elif (year == 1918):
        #Switch
        answer = "26.09.1918"
        
    else:
        feb = 0
        #Gregorian
        if ((year % 4) == 0 and year % 100 != 0) or (year % 400) == 0:
            #Leap year
            feb = 29
        else:
            #Not leap year
            feb = 28
        date = (noDays - (31+feb+31+30+31+30+31+31))
        answer = str(date)+".09."+str(year)
    return answer

if __name__ == '__main__':
    fptr = open(os.environ['OUTPUT_PATH'], 'w')

    year = int(input().strip())

    result = dayOfProgrammer(year)

    fptr.write(result + '\n')

    fptr.close()
