#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  V<> d{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  V<string> s{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
  while (true) {
    int x, y; cin >> x >> y, --x, --y;
    if (x == -1) break;
    int a = 0;
    for (int i = 0; i < x; ++i) a += d[i];
    a += y;
    cout << s[(a + 3) % 7] << '\n';
  }
}
