def get_day(date)
  m = date[0]
  d = date[1]
  info = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
  (m - 1).times do |i|
    d += info[i]
  end
  return case d % 7
    when 0 then "Wednesday"
    when 1 then "Thursday"
    when 2 then "Friday"
    when 3 then "Saturday"
    when 4 then "Sunday"
    when 5 then "Monday"
    when 6 then "Tuesday"
    end
end

loop do
  date = gets.chomp.split(" ").map(&:to_i)
  exit if date[0] == 0
  puts get_day(date)
end