wee = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
while True:
try:
y,m,d = map(int,input().split())
if m == 1 or m == 2:
m += 12
y -= 1
w = (d + 1 + 2*m + 3*(m + 1)// 5 + y + y//4 - y//100 + y//400)%7
print(wee[w])
except:
break