#include <iostream>
using namespace std;

int main() {
  while (true) {
    int m, d; cin >> m >> d;
    if (m == 0 && d == 0) break;
    int month[12] = {31,29,31,30,31,30,31,31,30,31,30,31};

    for (int i = 0; i < m - 1; i++) d += month[i];

    switch (d % 7) {
    case 1:
      cout << "Thursday" << endl;
      break;
    case 2:
      cout << "Friday" << endl;
      break;
    case 3:
      cout << "Saturday" << endl;
      break;
    case 4:
      cout << "Sunday" << endl;
      break;
    case 5:
      cout << "Monday" << endl;
      break;
    case 6:
      cout << "Tuesday" << endl;
      break;
    default:
      cout << "Wednesday" << endl;
      break;
    }
  }

  return 0;
}
