ds = [31,29,31,30,31,30,31,31,30,31,30,31]
s=["Wednesday",
   "Thursday",
   "Friday",
   "Saturday",
   "Sunday",
   "Monday",
   "Tuesday"
  ]
loop do
  m,d = gets.split.map &:to_i
  break if m == 0 && d == 0
  puts s[((0...m-1).inject(0){|s,i| s += ds[i]} + d)%7]
end