#include <bits/stdc++.h>
using namespace std;
int main(){
  long long a,b,cnt,mon[12]={0,31,29,31,30,31,30,31,31,30,31,30};
  string day[7]={"Wednesday","Thursday","Friday","Saturday","Sunday","Monday","Tuesday"};
  while(cin >> a >> b){
    if(a==0 and b==0){
      break;
    }
    cnt=b;
    for(int i=0;i<a;i++){
      cnt+=mon[i];
    }
    cout << day[cnt%7] << endl;
  }
  return 0;
}
