s = eval(input())

x = 7

if s == "SUN":

    pass

elif s == "SAT":

    x = x - 6

elif s == "FRI":

    x = x - 5

elif s == "THU":

    x = x - 4

elif s == "WED":

    x = x - 3

elif s == "TUE":

    x = x - 2

elif s == "MON":

    x = x - 1





print(x)

s = eval(input())



d = {

    "SUN": 7,

    "MON": 6,

    "TUE": 5,

    "WED": 4,

    "THU": 3,

    "FRI": 2,

    "SAT": 1

}



print((d[s]))
s = eval(input())
x = 7
if s == "SUN":
    pass
elif s == "SAT":
    x = x - 6
elif s == "FRI":
    x = x - 5
elif s == "THU":
    x = x - 4
elif s == "WED":
    x = x - 3
elif s == "TUE":
    x = x - 2
elif s == "MON":
    x = x - 1
print(x)

s = eval(input())
d = {"SUN": 7, "MON": 6, "TUE": 5, "WED": 4, "THU": 3, "FRI": 2, "SAT": 1}
print((d[s]))

-x = 7 -if s == "SUN": -    pass -elif s == "SAT": -    x = x - 6 -elif s == "FRI": -    x = x - 5 -elif s == "THU": -    x = x - 4 -elif s == "WED": -    x = x - 3 -elif s == "TUE": -    x = x - 2 -elif s == "MON": -    x = x - 1 -print(x) +d = {"SUN": 7, "MON": 6, "TUE": 5, "WED": 4, "THU": 3, "FRI": 2, "SAT": 1} +print((d[s]))