object Main {
    def main(args: Array[String]) = {
        val dates = List("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
        val days = List(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31).scanLeft(0)(_ + _)
        val in = io.Source.stdin.getLines.map(_.split(" ").map(_.toInt))
        in.takeWhile(!_.contains(0)).foreach(p => println(dates((days(p(0) - 1) + p(1) + 2) % 7)))
    }
}