#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int n;
int ans[10];
int a1[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int a2[]={0,31,29,31,30,31,30,31,31,30,31,30,31};
int main()
{
scanf("%d",&n);
int m=0,p=0;
for(int i=1;i<=n;i++)
{
int f=0;
if(((1900+i-1)%400==0)||((1900+i-1)%100!=0&&(1900+i-1)%4==0))
m++,f=1;
for(int j=1;j<=12;j++)
{
ans[(p+13)%7]++;
if(f)
p+=a2[j];
else p+=a1[j];
}
}
printf("%d ",ans[6]);
for(int i=0;i<6;i++)
printf("%d ",ans[i]);
return 0;
}