#
#
#selection stretch_ex1

date=int(input("please enter the date: "))
month=int(input("please enter the month: "))
year=int(input("please enter the year: "))

if month==1 and (date>0 or date<2 or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st january 200{1}".format(date,year))
elif month==2 and (date>0 or date<2 or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st February 200{1}".format(date,year))
elif month==3 and (date>0 or date<2or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st March 200{1}".format(date,year))
elif month==4 and (date>0 or date<2or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st April 200{1}".format(date,year))
elif month==5 and (date>0 or date<2or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st May 200{1}".format(date,year))
elif month==6 and (date>0 or date<2or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st June 200{1}".format(date,year))
elif month==7 and (date>0 or date<2or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st July 200{1}".format(date,year))
elif month==8 and (date>0 or date<2or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st Augast 200{1}".format(date,year))
elif month==9 and (date>0 or date<2or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st September 200{1}".format(date,year))
elif month==10 and (date>0 or date<2or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st October 200{1}".format(date,year))
elif month==11 and (date>0 or date<2or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st November 200{1}".format(date,year))
elif month==12 and (date>0 or date<2or (date>30 and date<32 )and (year>=1 and year<10)):
    print("{0}st December 200{1}".format(date,year))    

    
elif month==1 and (date>=2 and date<=30 and (year>=10 and year<100)):
    print("{0}th December 20{1}".format(date,year))
elif month==2 and (date>0 or date<2 and (date>30 and date<32 )and (year>=10 and year<100)):
    print("{0}st December 20{1}".format(date,year))
elif month==3 and (date>0 or date<2 and (date>30 and date<32 )and (year>=10 and year<100)):
    print("{0}st December 20{1}".format(date,year))
elif month==4 and (date>0 or date<2 and (date>30 and date<32 )and (year>=10 and year<100)):
    print("{0}st December 20{1}".format(date,year))
elif month==5 and (date>0 or date<2 and (date>30 and date<32 )and (year>=10 and year<100)):
    print("{0}st December 20{1}".format(date,year))
elif month==6 and (date>0 or date<2 and (date>30 and date<32 )and (year>=10 and year<100)):
    print("{0}st December 20{1}".format(date,year))
elif month==7 and (date>0 or date<2 and (date>30 and date<32 )and (year>=10 and year<100)):
    print("{0}st December 20{1}".format(date,year))
elif month==8 and (date>0 or date<2 and (date>30 and date<32 )and (year>=10 and year<100)):
    print("{0}st December 20{1}".format(date,year))
elif month==9 and (date>0 or date<2 and (date>30 and date<32 )and (year>=10 and year<100)):
    print("{0}st December 20{1}".format(date,year))
elif month==10 and (date>0 or date<2 and (date>30 and date<32 )and (year>=10 and year<100)):
    print("{0}st December 20{1}".format(date,year))
elif month==11 and (date>0 or date<2 and (date>30 and date<32 )and (year>=10 and year<100)):
    print("{0}st December 20{1}".format(date,year))
elif month==12 and (date>0 or date<2 and (date>30 and date<32 )and (year>=10 and year<100)):
    print("{0}st December 20{1}".format(date,year))    

