week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
sum=0 #๋ (day)์ ์ด ํฉ
a=[1,3,5,7,8,10,12] #31์ผ์ธ ๋ฌ
b=[4,6,9,11] #30์ผ์ธ ๋ฌ
m,d = map(int,input().split())
for i in range(1,m): # 1์์ธ ๊ฒฝ์ฐ๋
if i in a : sum+=31
elif i in b : sum+=30
elif i==2 : sum+=28 #2์์ 28์ผ๊น์ง
sum+=d
print(week[sum%7])