#!/usr/bin/ruby
# -*- coding: utf-8 -*-
=begin
Volume0-0027
=end

def wday(y,m,d)
  wd = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
  d = Time.new(y,m,d)
  return wd[d.wday]
end

class Main
  def initialize
    while STDIN.gets do
      m, d = $_.chomp.split.map{|x| x.to_i}
      if m==0 then
        break
      end

      puts wday(2004, m, d)
    end
  end
end

if $0 == __FILE__ then
  Main.new
end