x,y = map(int,input().split()) month = [31,28,31,30,31,30,31,31,30,31,30,31] day = ["MON","TUE","WED","THU","FRI","SAT","SUN"] y += sum(month[:x-1]) print(day[y%7 - 1])