#include <iostream>
using namespace std;

int main() {
  while(1) {
    int m,d;
    cin >> m >> d;
    if(m==0 && d==0) break;

    for(int i=1; i<m; i++) {
      switch(i){
      case 2:
	d+=29;
	break;
      case 4:
      case 6:
      case 9:
      case 11:
	d+=30;
	break;
      default :
	d+=31;
	break;
      }
    }
    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;
    case 0:
      cout << "Wednesday" << endl;
      break;
    }
  }
  return 0;
}
