
require "time"

date="2004 " + gets

case Time.strptime(date,"%Y %m %d").wday
when 1 then
	p "Monday"
when 2 then
	p "Tuesday"
when 3 then
	p "Wednesday"
when 4 then
	p "Thursday"
when 5 then
	p "Friday"
when 6 then
	p "Saturday"
when 7 then
	p "Sunday"
end