require "date"

while true
  m, d = gets.chomp.split(" ").map(&:to_i)
  exit if m == 0 && d == 0
  wday = Date.new(2004,m,d).wday
  case wday
  when 0
    puts "Sunday"
  when 1
    puts "Monday"
  when 2
    puts "Tuesday"
  when 3
    puts "Wednesday"
  when 4
    puts "Thursday"
  when 5
    puts "Friday"
  when 6
    puts "Saturday"
  end
end