require "date"

while (str = gets) != "0 0\n" do
	strArray = str.split("\s")
	month, day =  strArray[0], strArray[1]
	week = Date.new(2004, month.to_i, day.to_i).wday.to_i
	case week
		when 0 then
			puts "Sunday"
		when 1 then
			puts "Monday"
		when 2 then
			puts "Tuesday"
		when 3 then
			puts "Wednesday"
		when 4 then
			puts "Thursday"
		when 5 then
			puts "Friday"
		when 6 then
			puts "Saturday"
		else
	end
end