# import datetimeimport sys
if __name__=="__main__":
monthList =['January','February','March','April','May','June','July','August','September','October','November','December']
weekdayList =['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']for line in sys.stdin:# YYYYMMDD
day, month, year =tuple(line.split())# 9 October 2001
day =int(day)
month = monthList.index(month)+1
year =int(year)if month<3:
month+=12
year-=1
c = year//100
y = year -100*c
d = day
m = month
W = y +(y//4)+(c//4)-2*c +(26*(m+1))//10+ d -1
W %=7print(weekdayList[W])
import datetime
import sys
if __name__=="__main__":
monthList =['January','February','March','April','May','June','July','August','September','October','November','December']
weekdayList =['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']for line in sys.stdin:# YYYYMMDD
day, month, year =tuple(line.split())# 9 October 2001
day =int(day)
month = monthList.index(month)+1
year =int(year)
date = datetime.date(year,month,day)print(weekdayList[date.weekday()])