require 'date'

while line = STDIN.gets
  if line == "0 0\n" then break end
  m, d = line.chomp.split(" ").map { |item| item.to_i }

  dt = Date.new(2004, m, d)

  if dt.sunday? then
    puts "Sunday"
  elsif dt.monday? then
    puts "Monday"
  elsif dt.tuesday? then
    puts "Tuesday"
  elsif dt.wednesday? then
    puts "Wednesday"
  elsif dt.thursday? then
    puts "Thursday"
  elsif dt.friday? then
    puts "Friday"
  elsif dt.saturday? then
    puts "Saturday"
  end
end