require "date"
arr = Array.new
until (line = gets) == "0 0\n"
  arr << line
end
arr.each do |i|
  a = i.split(" ")
  a.map!{|j| j.to_i}
  m = a[0]
  d = a[1]
  wday = ["Sunday",
          "Monday",
          "Tuesday",
          "Wednesday",
          "Thursday",
          "Friday",
          "Saturday"]
  day = Date::new(2004, m, d)
  puts wday[day.wday]
end