dtotal = [31,29,31,30,31,30,31,31,30,31,30,31]

x = gets
y = x.split()
month = y[0].to_i
day = y[1].to_i
until month == 0
indexmonth = month - 1
s = 0
t = 0
if indexmonth == 0
 t = day % 7
else
 i = 0
 while i < indexmonth
  s += dtotal[i]
  i += 1
 end
 tt = s + day
 t = tt % 7
end

whatday = ["Wednesday","Thursday","Friday","Saturday","Sunday","Monday","Tuesday"]


puts whatday[t]

x = gets
y = x.split()
month = y[0].to_i
day = y[1].to_i
end
