Month = [0,31,29,31,30,31,30,31,31,30,31,30,31]
Week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
while (mon, day = gets.split(" ").map(&:to_i)) != [0,0]
  puts Week[(day + Month[0..(mon - 1)].inject{|sum,i|sum + i} + 2) % 7]
end