while True:
try:
y,m,d=map(int,input().split())
#c=y//100
#y=y%100
if m==1 or m==2:
y-=1
m+=12
#w=(int(c/4)-2*c+y+int(y/4)+int((13*(m+1))/5)+d-1)%7
w=(d+2*m+3*(m+1)//5+y+y//4-y//100+y//400)%7+1
if w==1:
p='Monday'
if w==2:
p='Tuesday'
if w==3:
p='Wednesday'
if w==4:
p='Thursday'
if w==5:
p='Friday'
if w==6:
p='Saturday'
if w==7:
p='Sunday'
print(p)
except EOFError:
break