months= ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']
endings = ['st','nd','rd']+17*['th']+['st','nd','rd']+7*['th']+['st']
year = input('Year:')
month = input('Mont(1-12):')
day = input('Day(1-31):')
month_number = int(month)
day_number =int(day)
month_name = months[month_number-1]
ordinal = day +endings[day_number-1]
print(month_name+' '+ordinal+','+year)
