days_in_month = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
day = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']

while True:
    m, d = map(int, input().split())
    if m == 0 or d == 0:
        break
    days = 0
    for month in range(0, m-1):
        days += days_in_month[month]
    days += d + 2
    days %= 7
    print(day[days])