
require "time"

date="2004 " + gets

case Time.strptime(date,"%Y %m %d").wday
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"
when 7 then
	puts "Sunday"
end