#!/usr/local/bin/ruby
a = Array.new
while (line = gets) != "0 0\n"
 a << line.split(" ").map(&:to_i)
end
a.each do |x,y|
 case x
  when 1
   ans = y
  when 2
   ans = 31 + y
  when 3
   ans = 60 + y
  when 4
   ans = 91 + y
  when 5
   ans = 121 + y
  when 6
   ans = 152 + y
  when 7
   ans = 182 + y
  when 8
   ans = 213 + y
  when 9
   ans = 244 + y
  when 10
   ans = 274 + y
  when 11
   ans = 305 + y
  when 12
   ans = 335 + y
 end
 case ans % 7
  when 0
   puts "Wednesday"
  when 1
   puts "Thursday"
  when 2
   puts "Friday"
  when 3
   puts "Saturday"
  when 4
   puts "Sunday"
  when 5
   puts "Monday"
  when 6
   puts "Tuesday"
 end
end