#include <iostream>
using namespace std;

int main(){
  int m,d;
  int cnt;
  string days[7]={"Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday"};
  while(1){
    cnt = 0;
    cin >> m >> d;
    if(m == 0 && d == 0) break;
    cnt += d;
    for(m--;m>0;m--){
      switch (m){
      case 4:
      case 6:
      case 9:
      case 11:
	cnt += 30;
      case 2:
	cnt += 29;
      default:
	cnt += 31;
      }
    }
    cout << days[cnt%7-1] << endl;
  }
}