#include <bits/stdc++.h>
using namespace std;
const int N = 7;
string D[N] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
int RES[N];
int main()
{
string s;
cin>>s;
int n;
cin>>n;
int ind = -1;
for(int i = 0; i < N; i++)
{
if (D[i] == s) ind = i;
}
while(ind < N && n)
{
RES[ind]++;
ind++;
n--;
}
for(int i = 0; i < N; i++)
{
RES[i] += n / N;
}
n %= N;
for(int i = 0; i < n; i++)
{
RES[i]++;
}
for(int i = 0; i < N; i++)
{
cout<<RES[i]<<' ';
}
cout<<endl;
}