n = [0,31,29,31,30,31,30,31,31,30,31,30,31]
w = ["Wednesday","Thursday","Friday","Saturday","Sunday","Monday","Tuesday"]
while gets
  m,d = $_.split.map(&:to_i)
  if m == 0 then break
  else puts w[(n[0..m-1].inject(:+)+d)%7] end
end