from datetime import date

while True:

    m, d = list(map(int, input().split()))

    if m == 0:

        break

    result = date(2004, m, d).isoweekday()

    print(("Monday"*(result==1)+"Tuesday"*(result==2)+"Wednesday"*(result==3)+"Thursday"*(result==4)+"Friday"*(result==5)+"Saturday"*(result==6)+"Sunday"*(result==7)))
from datetime import date

while True:

    m, d = list(map(int, input().split()))

    if m == 0:

        break

    result = date(2004, m, d).isoweekday()

    print(("Mon"*(result==1)+"Tues"*(result==2)+"Wednes"*(result==3)+"Thurs"*(result==4)+"Fri"*(result==5)+"Satur"*(result==6)+"Sun"*(result==7)+"day"))
from datetime import date

while True:
    m, d = list(map(int, input().split()))
    if m == 0:
        break
    result = date(2004, m, d).isoweekday()
    print(
        (
            "Monday" * (result == 1)
            + "Tuesday" * (result == 2)
            + "Wednesday" * (result == 3)
            + "Thursday" * (result == 4)
            + "Friday" * (result == 5)
            + "Saturday" * (result == 6)
            + "Sunday" * (result == 7)
        )
    )

from datetime import date

while True:
    m, d = list(map(int, input().split()))
    if m == 0:
        break
    result = date(2004, m, d).isoweekday()
    print(
        (
            "Mon" * (result == 1)
            + "Tues" * (result == 2)
            + "Wednes" * (result == 3)
            + "Thurs" * (result == 4)
            + "Fri" * (result == 5)
            + "Satur" * (result == 6)
            + "Sun" * (result == 7)
            + "day"
        )
    )

-            "Monday" * (result == 1) -            + "Tuesday" * (result == 2) -            + "Wednesday" * (result == 3) -            + "Thursday" * (result == 4) -            + "Friday" * (result == 5) -            + "Saturday" * (result == 6) -            + "Sunday" * (result == 7) +            "Mon" * (result == 1) +            + "Tues" * (result == 2) +            + "Wednes" * (result == 3) +            + "Thurs" * (result == 4) +            + "Fri" * (result == 5) +            + "Satur" * (result == 6) +            + "Sun" * (result == 7) +            + "day"