require "date"
arr = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]

while input = gets
  m, d = input.split.map(&:to_i)
  break if m == 0
  day = Date.new(2004, m, d)
  puts arr[day.wday]
end