#include <iostream>
#include<bits/stdc++.h>
using namespace std;
long long solve(long long a,long long b)//快速幂算法 :a^b=(a^b/2)^2
{
if(b==0) return 1;
if(b==1) return a;
long long r=0;
r=solve(a,b/2)%7;
r=r*r%7;
if(b%2) r=r*a%7;
return r;
}
int main(int argc, char** argv)
{
char str[7][15]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};//数组保存星期数据
long long a,b,result;
cin>>a>>b;
result=solve(a,b)%7;//对七取余算出下标
cout<<str[result];
return 0;
}