require "date"

YEAR = 2004
WDAY = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]

while true
  m, d = gets.split.map(&:to_i)
  
  break if m == 0 && d == 0
  
  puts WDAY[Date.new(YEAR, m, d).wday]
end