#include <stdio.h>

int total[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};

int Sum(int x) {
  int i, sum = 0;
  for(i = 0; i < x; i ++) {
    sum += total[i];
  }

  return sum;
}

int main() {
  int month, day;
  while(scanf("%d %d", &month, &day)) {
    if(month == 0) break;

    switch((Sum(month - 1) + day)%7) {
      case 0:
        printf("Thursday\n");
        break;

      case 1:
        printf("Friday\n");
        break;

      case 2:
        printf("Saturday\n");
        break;

      case 3:
        printf("Sunday\n");
        break;