import sys

from datetime import *

from time import *



day = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ]



while True:

    try:

        user_input_date = '2004/'+'/'.join(input().split())

        if user_input_date == '2004/0/0':

            break

        else:

            a = datetime.strptime(user_input_date,'%Y/%m/%d')

            print((day[a.weekday()]))

    except ValueError:

        pass

else:

    sys.exit(1)
import sys

from datetime import *

from time import *



day = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ]



while True:

    try:

        user_input_date = '2004/'+'/'.join(input().split())

        if user_input_date == '2004/0/0':

            break

        else:

            a = datetime.strptime(user_input_date,'%Y/%m/%d')

            print(day[a.weekday()])

    except ValueError:

        pass

else:

    sys.exit(1)
import sys
from datetime import *
from time import *

day = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
while True:
    try:
        user_input_date = "2004/" + "/".join(input().split())
        if user_input_date == "2004/0/0":
            break
        else:
            a = datetime.strptime(user_input_date, "%Y/%m/%d")
            print((day[a.weekday()]))
    except ValueError:
        pass
else:
    sys.exit(1)

import sys
from datetime import *
from time import *

day = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
while True:
    try:
        user_input_date = "2004/" + "/".join(input().split())
        if user_input_date == "2004/0/0":
            break
        else:
            a = datetime.strptime(user_input_date, "%Y/%m/%d")
            print(day[a.weekday()])
    except ValueError:
        pass
else:
    sys.exit(1)

-            print((day[a.weekday()])) +            print(day[a.weekday()])