#include<iostream>
#include<cstdio>

using namespace std;

int Month;
int Day;

const char *data[7] ={
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
  "Friday",
  "Saturaday",
  "Sunday"
};
const int days[12] = {31,29,31,30,31,30,31,31,30,31,30,31};

int ans[12][31];
int main(int argc, char *argv[])
{
  while(scanf("%d %d",&Month,&Day)){
      int d = 3;
    if(Month == 0)
      break;
    for(int i = 0;i < 12;i++){
      for(int j = 0;j < days[i];j++){
	ans[i][j] = d%7;
	d++;
      }
    }
    cout <<data[ans[Month-1][Day-1]]<<endl;
  }
  return 0;
}