Start: Jun, 26, 2019 08:30:00
2019年度暑期短学期第一天
End: Jun, 26, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 136ms
Memory: 24448kB
Author: 2018212212021
In contest: 1273

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