https://www.acmicpc.net/problem/1924
x,y=map(int,input().split())
arr=[31,28,31,30,31,30,31,31,30,31,30,31]
sum=0
for i in range(x-1): sum+=arr[i]
day=sum+y
if day%7==0: print("SUN")
elif day%7==1: print("MON")
elif day%7==2: print("TUE")
elif day%7==3: print("WED")
elif day%7==4: print("THU")
elif day%7==5: print("FRI")
else: print("SAT")