#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#define ll long long
using namespace std;
const int maxn = 110;
const int inf = 0x3f3f3f3f;
int n, m, k;
int a[maxn];
int main()
{
while (scanf("%d %d %d", &n, &m, &k) != EOF)
{
if (m == 1 || m == 2)
m += 12, n--;
int t = (k + 1 + 2 * m + 3 * (m + 1) / 5 + n + n / 4 - n / 100 + n / 400) % 7;
if (t == 0)
printf("Sunday\n");
if (t == 1)
printf("Monday\n");
if (t == 2)
printf("Tuesday\n");
if (t == 3)
printf("Wednesday\n");
if (t == 4)
printf("Thursday\n");
if (t == 5)
printf("Friday\n");
if (t == 6)
printf("Saturday\n");
}
return 0;
}