# coding: utf-8

days = [
  "Sunday",
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
  "Friday",
  "Saturday",
]

months = [
  31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
]

loop do
  m, d = gets.chomp.split(" ").map{|s| s.to_i}
  break if m == 0

  date = 3
  0..(m - 1).times do |i|
    date += months[i]
  end
  date += d
  puts "#{days[date %= days.length]}"
end