#include<stdio.h>
int main()
{
int n,i,j,r,i1,j1=1,max,c;
int date[8]={0};
freopen("friday.in","r",stdin);
freopen("friday.out","w",stdout);
scanf("%d",&n);
for (i=1900;i<=1899+n;i++)
{
r=0;
if (i%100==0)
{
if (i%400==0) r=1;
}else
{
if (i%4==0) r=1;
}
for(j=1;j<=12;j++)
{
c=0;
switch(j)
{
case 1:max=31;break;
case 3:max=31;break;
case 5:max=31;break;
case 8:max=31;break;
case 10:max=31;break;
case 12:max=31;break;
case 9:max=30;break;
case 4:max=30;break;
case 6:max=30;break;
case 11:max=30;break;
case 7:max=31;break;
case 2:
{
if (r==0) max=28;
else max=29;
break;
}
default:break;
}
for(i1=1;i1<=max;i1++)
{
if (j1==8) j1=1;
if (i1==13) date[j1]++;
j1++;
}
}
}
for (i=6;i<=7;i++) printf("%d ",date[i]);
for (i=1;i<=5;i++) printf("%d ",date[i]);
return 0;
}