ds = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
wd = [:Sunday, :Monday, :Tuesday, :Wednesday, :Thursday, :Friday, :Saturday]

while s = gets
  m, d = s.split.map(&:to_i)
  break if m == 0
  1.upto(m - 1).each { |i| d += ds[i - 1] }
  puts wd[(d - 4) % 7]
end