#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int zeller(int y, int m, int d) {
  if (m == 1 || m == 2) y--, m += 12;
  return (y + y / 4 - y / 100 + y / 400 + (13 * m + 8) / 5 + d) % 7;
}

const string s[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int m, d;
  while (cin >> m >> d, m) {
    cout << s[zeller(2004, m, d)] << endl;
  }

  return 0;
}
