semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(){
	int w,d,i;
	d=0;
	scanf("%d",&w);
	if(w==1){
		for(i=0;i<12;i++){
			if(i==0){
				if(13%7==5){
					printf("%d\n",i+1);
				}
			}
			else if(i==1||i==3||i==5||i==7||i==8||i==10){
			    d+=31;
			    if((d+13)%7==5){
				   printf("%d\n",i+1);
				}
			}
			else if(i==2){
				d+=28;
				if((d+13)%7==5){
				   printf("%d\n",i+1);
				}
			}
			else if(i==4||i==6||i==9||i==11){
				d+=30;
				if((d+13)%7==5){
				   printf("%d\n",i+1);
				}
			}
		}
	}
	else if(w==2){
		for(i=0;i<12;i++){
			if(i==0){
				if(13%7==4){
					printf("%d\n",i+1);
				}
			}
			else if(i==1||i==3||i==5||i==7||i==8||i==10){
			    d+=31;
			    if((d+13)%7==4){
				   printf("%d\n",i+1);
				}
			}
			else if(i==2){
				d+=28;
				if((d+13)%7==4){
				   printf("%d\n",i+1);
				}
			}
			else if(i==4||i==6||i==9||i==11){
				d+=30;
				if((d+13)%7==4){
				   printf("%d\n",i+1);
				}
			}
		}
	}
	else if(w==3){
		for(i=0;i<12;i++){
			if(i==0){
				if(13%7==3){
					printf("%d\n",i+1);
				}
			}
			else if(i==1||i==3||i==5||i==7||i==8||i==10){
			    d+=31;
			    if((d+13)%7==3){
				   printf("%d\n",i+1);
				}
			}
			else if(i==2){
				d+=28;
				if((d+13)%7==3){
				   printf("%d\n",i+1);
				}
			}
			else if(i==4||i==6||i==9||i==11){
				d+=30;
				if((d+13)%7==3){
				   printf("%d\n",i+1);
				}
			}
		}
	}
	else if(w==4){
		for(i=0;i<12;i++){
			if(i==0){
				if(13%7==2){
					printf("%d\n",i+1);
				}
			}
			else if(i==1||i==3||i==5||i==7||i==8||i==10){
			    d+=31;
			    if((d+13)%7==2){
				   printf("%d\n",i+1);
				}
			}
			else if(i==2){
				d+=28;
				if((d+13)%7==2){
				   printf("%d\n",i+1);
				}
			}
			else if(i==4||i==6||i==9||i==11){
				d+=30;
				if((d+13)%7==2){
				   printf("%d\n",i+1);
				}
			}
		}
	}
	else if(w==5){
		for(i=0;i<12;i++){
			if(i==0){
				if(13%7==1){
					printf("%d\n",i+1);
				}
			}
			else if(i==1||i==3||i==5||i==7||i==8||i==10){
			    d+=31;
			    if((d+13)%7==1){
				   printf("%d\n",i+1);
				}
			}
			else if(i==2){
				d+=28;
				if((d+13)%7==1){
				   printf("%d\n",i+1);
				}
			}
			else if(i==4||i==6||i==9||i==11){
				d+=30;
				if((d+13)%7==1){
				   printf("%d\n",i+1);
				}
			}
		}
	}
	else if(w==6){
		for(i=0;i<12;i++){
			if(i==0){
				if(13%7==0){
					printf("%d\n",i+1);
				}
			}
			else if(i==1||i==3||i==5||i==7||i==8||i==10){
			    d+=31;
			    if((d+13)%7==0){
				   printf("%d\n",i+1);
				}
			}
			else if(i==2){
				d+=28;
				if((d+13)%7==0){
				   printf("%d\n",i+1);
				}
			}
			else if(i==4||i==6||i==9||i==11){
				d+=30;
				if((d+13)%7==0){
				   printf("%d\n",i+1);
				}
			}
		}
	}
	else if(w==7){
		for(i=0;i<12;i++){
			if(i==0){
				if(13%7==6){
					printf("%d\n",i+1);
				}
			}
			else if(i==1||i==3||i==5||i==7||i==8||i==10){
			    d+=31;
			    if((d+13)%7==6){
				   printf("%d\n",i+1);
				}
			}
			else if(i==2){
				d+=28;
				if((d+13)%7==6){
				   printf("%d\n",i+1);
				}
			}
			else if(i==4||i==6||i==9||i==11){
				d+=30;
				if((d+13)%7==6){
				   printf("%d\n",i+1);
				}
			}
		}
	}
	return 0;
}
int main()

{   int r[12]={0,31,28,31,30,31,30,31,31,30,31,30};
	int i,j=0,k,l,m,n,s,t,a[12][2],b[12],w;
	for(i=0;i<12;i++)
	{b[i]=0;}
	cin>>w;
	for(i=0;i<12;i++)
		{a[i][0]=0;
	a[i][1]=i+1;}
    

	for(i=1;i<12;i++)
	{a[i][0]=a[i-1][0]+r[i];
	}
	for(i=0;i<12;i++)
	{
		if(a[i][0]%7==7-w)
			b[j]=a[i][1],j++;
	}
	if(b[0]!=0)
		cout<<b[0];
	for(i=1;b[i]!=0;i++)
		cout<<endl<<b[i];
}
main()
{
   int b[12],c[12],i,k,w;
   scanf("%d",&w);
   for(i=0;i<12;i++)
   {
     if(i==0||i==2||i==4||i==6||i==7||i==9||i==11)b[i]=31;
     else
       {
         if(i==1)b[i]=28;
         else b[i]=30;
       }
   }
   c[0]=14;
   for(i=0;i<12;i++)
   {  
     if((c[i]+w)%7==0)
     {printf("%d\n",i+1);}
     c[i+1]=c[i]+b[i];
   }
   }
main()
{
      int w;
      int i ,j ,k;
      scanf("%d",&w);
      int p[13];
      p[1]=31;
      p[3]=31;
      p[5]=31;
      p[7]=31;
      p[8]=31;
      p[10]=31;
      p[12]=31;
      p[2]=28;
      p[4]=30;
      p[6]=30;
      p[9]=30;
      p[11]=30;
      for(j=1;j<=12;j++)
      {
                        int sumday=12;
                        for(i=1;i<j;i++)
                        {
                                        sumday+=p[i];
                        }
                        k=sumday%7;
                       if((w+k)%7==5)
                       printf("%d\n",j);
      }
      return 0;
}
int main()
{
	int dayofthirteenth[12]={13,44,72,103,133,164,194,225,256,286,317,347};
	int w,month,k;
	scanf("%d",&w);
	for(month=0;month<=12;month++)
	{
	   for(k=0;k<60;k++)
	   {
	   	if(dayofthirteenth[month-1]==(-1-w+k*7))printf("%d\n",month);
	   }
	}
	
}
int main()
{
	
	int w,a,b,i;
	
	scanf("%d",&w);
	
	for(i=1;i<=12;i++)
	{
		if(i==1)
		{
			a=12+w;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}
		if(i==2)
		{
			a=12+w+31;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}
		if(i==3)
		{
			a=12+w+31+28;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}
		if(i==4)
		{
			a=12+w+31+28+31;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}
		if(i==5)
		{
			a=12+w+31+28+31+30;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}
		if(i==6)
		{
			a=12+w+31+28+31+30+31;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}
		if(i==7)
		{
			a=12+w+31+28+31+30+31+30;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}
		if(i==8)
		{
			a=12+w+31+28+31+30+31+30+31;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}
		if(i==9)
		{
			a=12+w+31+28+31+30+31+30+31+31;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}
		if(i==10)
		{
			a=12+w+31+28+31+30+31+30+31+31+30;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}
		if(i==11)
		{
			a=12+w+31+28+31+30+31+30+31+31+30+31;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}
		if(i==12)
		{
			a=12+w+31+28+31+30+31+30+31+31+30+31+30;
			b=a%7;
			if(b==5)
			{
				printf("%d\n",i);
			}
		}


	}
	 
	return 0;
}
int main()
{
	int w,i;
	scanf("%d",&w);
	for(i=1;i<13;i++)
	{
		switch(i)
		{
		case 1:w+=12;break;
		case 2:w+=31;break;
		case 3:w+=28;break;
		case 4:w+=31;break;
		case 5:w+=30;break;
		case 6:w+=31;break;
		case 7:w+=30;break;
        case 8:w+=31;break;
        case 9:w+=31;break;
        case 10:w+=30;break;
        case 11:w+=31;break;
        case 12:w+=30;break;
		}
		if(w%7==5)printf("%d\n",i);
	}
	return 0;
}
int main()
{
	int w;
	cin>>w;
	int aa[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int m=0;
	for(int i=0;i<=11;i++)
	{
		for(int j=0;j<=i;j++)
			m=m+aa[j];
		m=m-(aa[i]-13+1);
		if((m+(w-5))%7==0)
			cout<<i+1<<endl;
		m=0;
	}
	return 0;
}
int main(int argc, char* argv[])
{
	int mth[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int n,i,j,sum=0;
	scanf("%d",&n);
	for (i=1;i<=12;i++) {
		for(j=0;j<i-1;j++) {
			sum=sum+mth[j];
		}
		if ((sum+13+n-1)%7==5) {
			printf("%d\n",i);
		}
		sum=0;
	}
	return 0;
}
int main(){
    int w,a,b;
    scanf("%d",&w);
    a=12%7;
    if(w+a==5)
    printf("1\n");
    if(w+a-7==5)
    printf("1\n");
    a=(31+12)%7;
    if(w+a==5)
    printf("2\n");
    if(w+a-7==5)
    printf("2\n");
    a=(31+28+12)%7;
    if(w+a==5)
    printf("3\n");
    if(w+a-7==5)
    printf("3\n");
    a=(31+28+31+12)%7;
    if(w+a==5)
    printf("4\n");
    if(w+a-7==5)
    printf("4\n");
    a=(31*2+28+30+12)%7;
    if(w+a==5)
    printf("5\n");
    if(w+a-7==5)
    printf("5\n");
    a=(31*3+28+30+12)%7;
    if(w+a==5)
    printf("6\n");
    if(w+a-7==5)
    printf("6\n");
    a=(31*3+28+60+12)%7;
    if(w+a==5)
    printf("7\n");
    if(w+a-7==5)
    printf("7\n");
    a=(31*4+28+60+12)%7;
    if(w+a==5)
    printf("8\n");
    if(w+a-7==5)
    printf("8\n");
    a=(31*5+28+60+12)%7;
    if(w+a==5)
    printf("9\n");
    if(w+a-7==5)
    printf("9\n");
    a=(31*5+28+90+12)%7;
    if(w+a==5)
    printf("10\n");
    if(w+a-7==5)
    printf("10\n");
    a=(31*6+28+90+12)%7;
     if(w+a==5)
    printf("11\n");
    if(w+a-7==5)
    printf("11\n");
    a=(31*6+28+120+12)%7;
     if(w+a==5)
    printf("12\n");
    if(w+a-7==5)
    printf("12\n");
    return 0;
}
//?????
int main()
{
	int m2[12],b[12],c[12],w;
	cin>>w;
	for(int i=0;i<12;i++)
	{
		m2[i]=i+1;
		switch(m2[i])
		{
			case 1:m2[i]=13;break;
			case 2:m2[i]=31+13;break;
			case 3:m2[i]=31+28+13;break;
			case 4:m2[i]=31+28+31+13;break;
			case 5:m2[i]=31+28+31+30+13;break;
			case 6:m2[i]=31+28+31+30+31+13;break;
			case 7:m2[i]=31+28+31+30+31+30+13;break;
			case 8:m2[i]=31+28+31+30+31+30+31+13;break;
			case 9:m2[i]=31+28+31+30+31+30+31+31+13;break;
			case 10:m2[i]=31+28+31+30+31+30+31+31+30+13;break;
			case 11:m2[i]=31+28+31+30+31+30+31+31+30+31+13;break;
			case 12:m2[i]=31+28+31+30+31+30+31+31+30+31+30+13;break;
		}
		b[i]=(m2[i]-1)%7;
		c[i]=(b[i]+w)%7;
		if(c[i]==5)
		{
			m2[i]=i+1;
			cout<<m2[i]<<endl;
		}
	}
	return 0;
}
int main()
{
int w;
cin>>w;
int m[13];
m[1]=w+12;
m[2]=m[1]+31;
m[3]=m[2]+28;
m[4]=m[3]+31;
m[5]=m[4]+30;
m[6]=m[5]+31;
m[7]=m[6]+30;
m[8]=m[7]+31;
m[9]=m[8]+31;
m[10]=m[9]+30;
m[11]=m[10]+31;
m[12]=m[11]+30;
for (int i=1;i<=12;i++)
{
if (m[i]%7==5)cout<<i<<endl;
}
}
int main()
{
	int thir[MON], i, w;
	scanf("%d", &w);
	thir[0]=13+w-1;
    thir[1]=31+13+w-1;
    thir[2]=31+28+13+w-1;
    thir[3]=31+28+31+13+w-1;
    thir[4]=31+28+31+30+13+w-1;
    thir[5]=31+28+31+30+31+13+w-1;
    thir[6]=31+28+31+30+31+30+13+w-1;
    thir[7]=31+28+31+30+31+30+31+13+w-1;
    thir[8]=31+28+31+30+31+30+31+31+13+w-1;
    thir[9]=31+28+31+30+31+30+31+31+30+13+w-1;
    thir[10]=31+28+31+30+31+30+31+31+30+31+13+w-1;
    thir[11]=31+28+31+30+31+30+31+31+30+31+30+13+w-1;
	for (i=0; i<MON; i++)
	{
		if (thir[i]%7==5)
		{
			printf("%d\n", i+1);
		}
	}
	return 0;
}
int main(){
int i,w;
scanf("%d",&w);
int a[365];
for(i=0;i<365;i++,w++){
    a[i]=w%7;}
if(a[12]==5)printf("1\n");
if(a[43]==5)printf("2\n");
if(a[71]==5)printf("3\n");
if(a[102]==5)printf("4\n");
if(a[132]==5)printf("5\n");
if(a[163]==5)printf("6\n");
if(a[193]==5)printf("7\n");
if(a[224]==5)printf("8\n");
if(a[255]==5)printf("9\n");
if(a[285]==5)printf("10\n");
if(a[316]==5)printf("11\n");
if(a[346]==5)printf("12\n");

return 0;
}
int main()
{
	int day,mon[12],i=0,k;

	scanf("%d",&day);

	if((13+day+1)%7==0)
	{mon[i]=1;
	i++;}

	if((13+day+1+31)%7==0)
	{mon[i]=2;
	i++;}

	if((13+day+1+31+28)%7==0)
		{mon[i]=3;
	i++;}

	if((13+day+1+31+28+31)%7==0)
		{mon[i]=4;
	i++;}

	if((13+day+1+31+28+31+30)%7==0)
		{mon[i]=5;
	i++;}

	if((13+day+1+31+28+31+30+31)%7==0)
	{mon[i]=6;
	i++;}

	if((13+day+1+31+28+31+30+30+31)%7==0)
	{mon[i]=7;
	i++;}

	if((13+day+1+31+28+31+30+30+31+31)%7==0)
	{mon[i]=8;
	i++;}

	if((13+day+1+31+28+31+30+30+31+31+31)%7==0)
	{mon[i]=9;
	i++;}

	if((13+day+1+31+28+31+30+30+31+31+31+30)%7==0)
	{mon[i]=10;
	i++;}

	if((13+day+1+31+28+31+30+30+31+31+31+30+31)%7==0)
	{mon[i]=11;
	i++;}

	if((13+day+1+31+28+31+30+30+31+31+31+30+31+30)%7==0)
	{mon[i]=12;
	i++;}

	k=i;

	printf("%d",mon[0]);

	for(i=1;i<k;i++)
		printf("\n%d",mon[i]);

	return 0;
}
int main(int argc, char* argv[])
{
	int i,w,s,s1=0,m[12]={0,31,28,31,30,31,30,31,31,30,31,30};	
	scanf("%d",&w);
	for(i=0;i<12;i++)
	{
		s1+=m[i];
		s=w+12+s1;
		if(s%7==5) printf("%d\n",i+1);

	}
	
	return 0;



}
int dijitian(int m,int d)
{
	int q=0;
	q=d;
	switch(m)
	{
		case 12: q+=30;
		case 11: q+=31;
		case 10: q+=30;
		case 9: q+=31;
		case 8: q+=31;
		case 7: q+=30;
		case 6: q+=31;
		case 5: q+=30;
		case 4: q+=31;
		case 3: q+=28;
		case 2: q+=31;
		case 1: q+=0;
	}
	return q;
}

int main()
{
	int d,k,i,j;
	scanf("%d",&k);
	for(i=1;i<=12;i++)
	{
		d=dijitian(i,13);
		j=d%7+k-1;
		if (j>7) j-=7;
		if (j==5) printf("%d\n",i);
	}
	return 0;
}
int main()
{
    int w,w1;
    
    scanf("%d", &w);
    if(w>=1 && w<=5)
        w1 = 6 - w;
    else
        w1 = 13- w;
    if(w==7)
        printf("1\n");
    if((13+31-w1)%7 == 0)
        printf("2\n");
    if((13+28+31-w1)%7 == 0)
        printf("3\n");
    if((13+31+28+31-w1)%7 == 0)
        printf("4\n");
    if((13+30+31+28+31-w1)%7 == 0)
        printf("5\n");
    if((13+31+30+31+28+31-w1)%7 == 0)
        printf("6\n");
    if((13+30+31+30+31+28+31-w1)%7 == 0)
        printf("7\n");
    if((13+31+30+31+30+31+28+31-w1)%7 == 0)
        printf("8\n");
    if((13+31+31+30+31+30+31+28+31-w1)%7 == 0)
        printf("9\n");
    if((13+30+31+31+30+31+30+31+28+31-w1)%7 == 0)
        printf("10\n");
    if((13+31+30+31+31+30+31+30+31+28+31-w1)%7 == 0)
        printf("11\n");
    if((13+30+31+30+31+31+30+31+30+31+28+31-w1)%7 == 0)
        printf("12\n");
    
    
    return 0;
}
int main()
{
    int w;
    scanf("%d", &w);
    int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    
    int firstday[13];
    int i;
    
    firstday[1] = 1;
    for(i = 2; i <= 12; i++)
          firstday[i] = firstday[i - 1] + days[i - 1];
    
    int day13[13];
    for(i = 1; i <= 12; i++)
          day13[i] = firstday[i] + 12;
    
    int week[13];
     for(i = 1; i <= 12; i++)
     {
          week[i] = (day13[i] - 1 + w) % 7;
          if(week[i] == 5)
                     printf("%d\n", i);
     }
          
      
    return 0;
}
int main()
{
    int w, m = 1, day, a;
    cin >> w;
    day = 12;
    do
    {
        if(m == 3)
            day += 28;
        else
        {
           if(m == 5 || m == 7 || m == 10 || m == 12)
              day += 30;
           else
              if(m != 1)
              day += 31;
        }
        a = day % 7;
        if((a + w) % 7 == 5)
            cout << m << endl;
        m++;
    }while(m <= 12);
    return 0;
}
int main ()
{
	int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int i,l,k,day=0,n,m;
	scanf("%d",&n);
	for(i=0;i<12;i++)
	{
		if(((day+13)%7)==((5-n+8)%7))
		{
			printf("%d",i+1);
			if(i!=11)
			printf("\n");
		}
		day=day+a[i];
	}
	
	return 0;
}
int main( )
{
	int day,mon,i,sum,xingqiji;
	cin >> day;
	sum = day + 12;
	for ( mon = 1; mon <= 12; mon++)
	{
		switch(mon)
		{
			case 1 : i = 0; break;
			case 2 : 
			case 4 : 
			case 6 : 
			case 8 :
			case 9 : 
			case 11 : i = 31; break;
			case 3 : i = 28; break;
			case 5 : 
			case 7 : 
			case 10 : 
			case 12 : i = 30; break;
		}
		sum = sum + i;
		xingqiji = sum % 7;
		if ( xingqiji == 5 ) cout << mon << endl;
	}
	return 0;
}
int main()
{
	int w;
	scanf("%d",&w);
	if((w+7)%7==0)
     printf("1\n");
	 if((w+10)%7==0)
	 printf("2\n3\n");
	 if((w+13)%7==0)
	 printf("4\n");
	 if((w+15)%7==0)
	 printf("5\n");
	 if((w+18)%7==0)
		 printf("6\n");
	 if((w+20)%7==0)
		 printf("7\n");
	 if((w+23)%7==0)
		 printf("8\n");
	 if((w+26)%7==0)
		 printf("9\n12\n");
	 if((w+28)%7==0)
		 printf("10\n");
	 if((w+31)%7==0)
		printf("11\n");
	
 return 0;
}
int main(){
int n,i,k,w;
scanf("%d",&w);
if((w+5)%7==5){
printf("%d\n",1);
}
if((w+36)%7==5){
printf("%d\n",2);
}
if((w+36+28)%7==5){
printf("%d\n",3);
}
if((w+36+28+31)%7==5){
printf("%d\n",4);
}
if((w+36+28+61)%7==5){
printf("%d\n",5);
}
if((w+36+28+92)%7==5){
printf("%d\n",6);
}
if((w+36+28+122)%7==5){
printf("%d\n",7);
}
if((w+36+28+153)%7==5){
printf("%d\n",8);
}
if((w+36+28+184)%7==5){
printf("%d\n",9);
}
if((w+36+28+214)%7==5){
printf("%d\n",10);
}
if((w+36+28+245)%7==5){
printf("%d\n",11);
}
if((w+36+28+275)%7==5){
printf("%d\n",12);
}
return 0;
}
void main()
{
 int w;
 scanf("%d\n",&w);
 int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
 int b[12],i,j; // ???13??1.1??????????
  b[0]=12;
 for(i=1;i<12;i++)
   { b[i]=0;
     for(j=0;j<i;j++)
      b[i]=b[i]+a[j];      
      b[i]=b[i]+12;
    }
 for(i=0;i<12;i++)
   {
     int y;
     y=b[i]%7;
     if((y+w)%7==5)
     printf("%d\n",i+1);
    }        
 }
int main(){
	int n;cin>>n;
	int num;
	if(5-n<0) num=5-n+7;
	else num=5-n;
	int month[12]={0,31,59,90,120,151,181,212,243,273,304,334};
	for(int i=0;i<12;i++){
		if((month[i]+12)%7==num) {cout<<i+1<<endl;}
	}

}
int main()
{
     int month[12]={31,28,31,30,31,30,31,31,30,31,30,31} , i , j, n, sum = 0 ,b[200][4],temp=0;
     scanf( "%d",&n );
     sum = n + 12;
     if( sum % 7 == 5 )
     printf("1\n");
     for(i = 1 ;i <= 11; i++ )
     {
     sum += month[i-1];
      if( sum % 7 == 5 )
      printf("%d\n",i+1);      
     }     
}
int main()
{
    int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31},i,sum=12,w;
    scanf("%d",&w);
    if(w==7)
        printf("1\n");
    for(i=1;i<=11;i++)
    {
        sum=sum+days[i];
        if(w>=1&&w<=5)
        {if(sum%7==(5-w))
            printf("%d\n",i+1);}
        else
        {if(sum%7==(12-w))
            printf("%d\n",i+1);}
    }
    return 0;
}
int main(){
   int w,d[13],r=0,i;
   scanf("%d",&w);
   d[1]=12;
   d[2]=12+31;
   d[3]=d[2]+28;
   d[4]=d[3]+31;
   d[5]=d[4]+30;
   d[6]=d[5]+31;
   d[7]=d[6]+30;
   d[8]=d[7]+31;
   d[9]=d[8]+31;
   d[10]=d[9]+30;
   d[11]=d[10]+31;
   d[12]=d[11]+30;
	   if(w==5){
		   for(i=1;i<=12;i++){
			   if(d[i]%7==0){
				   printf("%d\n",i);
			   }
		   }
	   }else if(w==4){
		   for(i=1;i<=12;i++){
			   if(d[i]%7==1){
				   printf("%d\n",i);
			   }
		   }
	   }else if(w==3){
		   for(i=1;i<=12;i++){
			   if(d[i]%7==2){
				   printf("%d\n",i);
			   }
		   }
	   }else if(w==2){
		   for(i=1;i<=12;i++){
			   if(d[i]%7==3){
				   printf("%d\n",i);
			   }
		   }
	   }else if(w==1){
		   for(i=1;i<=12;i++){
			   if(d[i]%7==4){
				 printf("%d\n",i);
			   }
		   }
	   }else if(w==6){
		   for(i=1;i<=12;i++){
			   if(d[i]%7==6){
				  printf("%d\n",i);
			   }
		   }
	   }else if(w==7){
		   for(i=1;i<=12;i++){
			   if(d[i]%7==5){
				   printf("%d\n",i);
			   }
		   }
	   }
	return 0;
}
int main()
{
   int a,i,d1,day=0;
   cin>>a;
   for(i=1;i<=12;i++)
	   {   if(((day+12)%7+a)%7==5) cout<<i<<endl;
		   if(i==1||i==3||i==5||i==7||i==8||i==10||i==12) day+=31;
         else if(i==2) day+=28;
		 else day+=30;}
   return 0;
}
int main()
{
	int w,m,d,a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d",&w);
	w=w+12;
	if (w>7) w=w%7;
	if (w==5) printf("1\n");
	for  (m=2;m<=12;m++){
		w=w+a[m-2];
        if (w>7) w=w%7;
	    if (w==5) printf("%d\n",m);
	}
	return 0;
}
int main()
{
	int w,i=0,a[400],x=0,y,z,month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d",&w);
	for(i=1;i<=12;i++)
	{
	x=x+month[i-1];
	z=(x+12)%7;
	y=w+z;
	  if(y>7)
	  {
		  y=y-7;
		  if(y==5)
		  {
			  printf("%d\n",i);
		  }
		  else
		  {
			  continue;
		  }
	  }
	  else
	  {
		  if(y==5)
		  {
			  printf("%d\n",i);
		  }
		  else
		  {
			  continue;
		  }
	  }
	}
	return 0;
}
//**************************************
//?????????                   *
//?????                           *
//???2013/10/30                     *
//????????????????     *
//**************************************
int main()
{
    int w;
	cin>>w;
	int A[13]={0,31,28,31,30,31,30,31,31,30,31,30,31},B[13]={0,13,13,13,13,13,13,13,13,13,13,13,13};
	for(int i=1;i<13;i++)
	{
		for(int j=0;j<i;j++)
		{
			B[i]=B[i]+A[j];
		}
		if((B[i]+w-1)%7==5)
			cout<<i<<endl;
	}
	return 0;
}
main()
{
    int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    int i,t,w,x;
    scanf("%d",&w);
    for(i=1;i<12;i++)
    {
        a[i]=a[i-1]+a[i];              
    }
    x=13-w;
    if(13-x==7)  printf("1\n");
    for(i=1;i<12;i++)
    {
            if((a[i-1]+13-x)%7==0)
            printf("%d\n",i+1);                     
    }
   
}
int main()
{
    int a,b,c=13,i=0;
    scanf("%d",&a);
    for(b=0;b<12;b++)
    {
                     if((b-1)*(b-3)*(b-5)*(b-7)*(b-8)*(b-10)*(b-12)==0)
                     c=c+31;
                     if((b-4)*(b-6)*(b-9)*(b-11)==0)
                     c=c+30;
                     if(b==2)
                     c=c+28;
                     if((c+a-1)%7==5)
                     {
                     if(i!=0)
                     printf("\n");
                     i++;
                     printf("%d",b+1);
                     }
                     }
    }
main()
{
	int w,i,e;
	scanf("%d",&w);
	w+=12;
	for (i=1;;i++)
	{
		e=w%7;
		if (e==5)
			printf ("%d\n",i);
		if (i==1||i==3||i==5||i==7||i==8||i==10)
			w+=31;
		else if (i==4||i==6||i==9||i==11)
			w+=30;
		else if (i==2)
			w+=28;
		else
			break;
	}
}
void main()
{
	int w,i,day[13];
	scanf("%d",&w);
	day[1]=w+12;
	for(i=1;i<12;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10)day[i+1]=day[i]+31;
		else if(i==2)day[i+1]=day[i]+28;
		else if(i==4||i==6||i==9||i==11)day[i+1]=day[i]+30;
	}
	for(i=1;i<=12;i++)
	{
		if(day[i]%7==5)printf("%d\n",i);
	}
}
int main()
{
	int w,i,j;
	scanf("%d",&w);
	int a[12];
	a[0]=12;
	a[1]=43;
	a[2]=71;
	a[3]=102;
	a[4]=132;
	a[5]=163;
	a[6]=193;
	a[7]=224;
	a[8]=255;
	a[9]=285;
	a[10]=316;
	a[11]=346;
	for(i=0;i<=11;i++)
	{
		a[i]=w+(a[i]%7);
		if(a[i]>7)
		{
			a[i]=a[i]-7;
		}
	    if(a[i]==5)
		{
			printf("%d\n",(i+1));
		}
	}
	return 0;
}
int main()
{
int n,d[12]={31,28,31,30,31,30,31,31,30,31,30,31},i,j=2;
cin>>n;
if((n+13)%7==6)
 cout<<1<<endl;
for(i=0;i<12;i++)
{n+=d[i]%7; 
if((n%7+5)%7==5&&j<13)
   cout<<j<<endl;
j++;                 
} 
 
return 0; 
}
void main()
{
	int i;
	int r[13];
	int y[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d",&r[0]);
	r[1]=r[0]+12;
	for(i=2;i<13;i++)
		r[i]=r[i-1]+y[i-2];
	for(i=1;i<13;i++)
		if(r[i]%7==5)
			printf("%d\n",i);


}
int main()
{
	int w0,m,d,dmax[13],w;
	scanf("%d",&w0);
	w=w0;
	for(m=1;m<=12;m++)
	{
		if(m==1||m==3||m==5||m==7||m==8||m==10||m==12) dmax[m]=31;
		if(m==4||m==6||m==9||m==11) dmax[m]=30;
		if(m==2) dmax[m]=28;
	}
	m=1;
	for(d=1;d<=dmax[m];)
	{
		if(m>12) break;
		if(d==dmax[m])
		{
			d=1;
			m++;
		}
		else
		{
			d++;
		}
		if(w==7) w=1;
		else w++;
		if(d==13&&w==5) printf("%d\n",m);
	}
	return 0;
}
int main()
{
	int n,i,j,k,l;
	scanf("%d",&n);
	for(i=1;i<=365;i++)
	{
		if(i%7+n==6||i%7+n==13)
		{
			if(i==13)
				printf("1\n");
			if(i==44)
				printf("2\n");
			if(i==72)
				printf("3\n");
			if(i==103)
				printf("4\n");
			if(i==133)
				printf("5\n");
			if(i==164)
				printf("6\n");
			if(i==194)
				printf("7\n");
			if(i==225)
				printf("8\n");
			if(i==256)
				printf("9\n");
			if(i==286)
				printf("10\n");
			if(i==317)
				printf("11\n");
			if(i==347)
				printf("12\n");
		}
	}
	
	return 0;
}
main()
{int i,j,k=0,m,n,a,b,c=0,w;
 scanf("%d",&w);
 int tian[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
 int jg[12];
 for(i=0;i<12;i++)
  {c=c+tian[i];
   m=(c+12)%7;
   if((w+m)<=7)
      n=w+m;
   else  {n=m-(7-w);}  
  if(n==5)
  {jg[k]=i+1;k++;}
  }
 for(j=0;j<k;j++)
   printf("%d\n",jg[j]);
 
 
}
void main()
{
	int w;
	char c;
   scanf("%d",&w);
	for(;(c=getchar())!=EOF;)
	{
		scanf("%d",&w);
		if(w==1)printf("4\n7");
		else if(w==2)printf("9\n12");
		else if(w==3)printf("6");
		else if(w==4)printf("2\n3\n11");
		else if(w==5)printf("8");
		else if(w==6)printf("5");
		else if(w==7)printf("1\n10");
		printf("\n");
	}
}
int main()
{
	int n;
	scanf("%d",&n);
	if(13%7==6-n||13%7==13-n){printf("1\n");}if(44%7==6-n||44%7==13-n){printf("2\n");}if(72%7==6-n||72%7==13-n){printf("3\n");}
	if(103%7==6-n||103%7==13-n){printf("4\n");}if(133%7==6-n||133%7==13-n){printf("5\n");}if(164%7==6-n||164%7==13-n){printf("6\n");}
	if(194%7==6-n||194%7==13-n){printf("7\n");}if(225%7==6-n||225%7==13-n){printf("8\n");}if(256%7==6-n||256%7==13-n){printf("9\n");}
	if(286%7==6-n||286%7==13-n){printf("10\n");}if(317%7==6-n||317%7==13-n){printf("11\n");}if(347%7==6-n||347%7==13-n){printf("12\n");}
return 0;
}
/**
 * ???8.cpp
 * ????????
 * ??????
 * ???2010?11?14?
 */
int main()
{
    int a[12]={12,43,71,102,132,163,193,224,255,285,316,346};//????a????13???????????
    int b[12],i,w;//????b?????13?????,w????????????
    cin>>w;
    for(i=0;i<12;i++)
	{         
         b[i]=a[i]%7+w;    //????13?????
         if(b[i]>7)
		 {b[i]=b[i]-7;}
         if(b[i]==5)       //??13????????
		 {cout<<i+1<<endl;}
	}
return 0;
}
int main()
{
	int w,a[12],a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12;
	cin>>w;
	a1=(w%7);
	a[0]=a1;
	a2=(31+w)%7;
	a[1]=a2;
	a3=(59+w)%7;
	a[2]=a3;
	a4=(90+w)%7;
	a[3]=a4;
	a5=(120+w)%7;
	a[4]=a5;
	a6=(151+w)%7;
	a[5]=a6;
	a7=(181+w)%7;
	a[6]=a7;
	a8=(212+w)%7;
	a[7]=a8;
	a9=(243+w)%7;
	a[8]=a9;
	a10=(273+w)%7;
	a[9]=a10;
	a11=(304+w)%7;
	a[10]=a11;
	a12=(334+w)%7;
	a[11]=a12;
	for(int i=0;i<=11;i++)
		if(a[i]==0)
	cout<<i+1<<endl;
	return 0;
}