#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main()
{
  int days[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

  int month, day;
  while(true)
  {
    cin >> month >> day;
    if(!month && !day)
      break;
    switch((days[month] + day) % 7)
    {
    case 6:
      cout << "Thursday";
      break;
    case 0:
      cout << "Friday";
      break;
    case 1:
      cout << "Saturday";
      break;
    case 2:
        cout << "Sunday";
      break;
    case 3:
      cout << "Monday";
      break;
    case 4:
      cout << "Tuesday";
      break;
    case 5:
      cout << "Wednesday";
    }
    cout << endl;
  }

  return 0;
}