semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int w,i,j;
	scanf("%d",&w);
	int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int day[13];
	day[1]=13;
	for(i=2;i<13;i++)
	{
		
		day[i]=day[i-1]+month[i-1];
	}

	for(i=1;i<13;i++)
	{
		if((day[i]+w-1)%7==5)
			printf("%d\n",i);
	    else continue;
	}
	return 0;
}
int main()

{
	int w;
	int a[60], md[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int i, j = 0, k, l, t;
	cin >> w;
	t = 5 - w;
	if (t < 0)
	{
		t = t + 7;
	}
	for (i = 1 + t; i < 366; i+=7)
	{
		a[j] = i;
		j++;
	}
	for (k = 0; k < j; k++)
	{
		for (l = 0; l < 12; l++)
		{
			if (a[k] > md[l])
			{a[k] = a[k] - md[l];}
			else break;
		}
		if (a[k] == 13)
		{cout << l + 1 << endl;}
	}
	return 0;
}
int main()
{
    int w;
	scanf("%d",&w);
	if((12%7+w)%7==5)
		printf("1\n");
    if((43%7+w)%7==5)
		printf("2\n");
    if(((43+28)%7+w)%7==5)
		printf("3\n");
    if(((43+28+31)%7+w)%7==5)
		printf("4\n");

    if(((43+28+31+30)%7+w)%7==5)
		printf("5\n");
    if(((43+28+31+30+31)%7+w)%7==5)
		printf("6\n");
    if(((43+28+31+30+31+30)%7+w)%7==5)
		printf("7\n");
    if(((43+28+31+30+31+30+31)%7+w)%7==5)
		printf("8\n");

	if(((43+28+31+30+31+30+62)%7+w)%7==5)
		printf("9\n");
	if(((43+28+31+30+31+30+62+30)%7+w)%7==5)
		printf("10\n");
	if(((43+28+31+30+31+30+62+61)%7+w)%7==5)
		printf("11\n");
	if(((43+28+31+30+31+30+62+61+30)%7+w)%7==5)
		printf("12\n");
	return 0;
}
struct form{
	int month;
	int day;
	int date;
}every[365];

void main(){
	int firstday,month=1,date=1,day;
	int monthday[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int i;
	scanf("%d",&firstday);
	day=firstday;
	for(i=0;i<365;i++){
		every[i].month=month;
		every[i].day=day;
		every[i].date=date;
		if(every[i].date==monthday[month-1]){
			month++;
			date=1;
		}else{
			date++;
		}
		if(every[i].day==7){
			day=1;
		}else{
			day++;
		}
	}
	for(i=0;i<365;i++){
		if(every[i].date==13&&every[i].day==5){
			printf("%d\n",every[i].month);
		}
	}
}
int main()
{
    int w,a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    int b[12],sum=0;
    cin>>w;
    b[0]=(w+5)%7;     //???13???????0????? 
    for(int i=1;i<12;i++)
    {
            sum+=a[i-1];
            b[i]=(sum+12+w)%7;      //?i+1?????? 
    }
    for(int j=0;j<12;j++)
    {
            if(b[j]==5)  cout<<j+1<<endl;
    }
    return 0;
}
int main(int argc, char* argv[])
{
	int i,j,w,a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31},n;
	scanf("%d",&w);
	n=(w+12)%7;
	if(n==5){
		printf("%d\n",1);
	}
	for(i=1;i<=11;i++){
		n=(n+a[i])%7;
		if(n==5){
			printf("%d\n",i+1);
		}
	}
	return 0;
}
int main()
{
	int a,b,i;
	scanf("%d",&a);
	a=a+12;
	for(i=1;i<=12;i++)
	{
		b=a%7;
		if(b==5)
			printf("%d\n",i);
        if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			a=a+31;
		}
		else if(i==4||i==6||i==9||i==11)
		{
			a=a+30;
		}
		else 
		{
			a=a+28;
		}
	}	
	return 0;
}
main()
{
	int w,i,j,k,c=0;
	scanf("%d",&w);
	c=7+w;
	if(c%7==0)
		printf("1\n");
	for(i=1;i<12;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10)
			c=c+31;
		if(i==4||i==6||i==9||i==11)
			c=c+30;
		if(i==28)
			c=c+28;
		if(c%7==0)
			printf("%d\n",i+1);
	}
	return 0;
}
main()
{
	int days[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int m=0,w;
	scanf ("%d",&w);
	if((w+12)%7==5)
	printf ("1\n");
	for (int i=2;i<=12;i++){
		
		 for (int j=1;j<=i-1;j++)
		 {
		 m+=days[j];}
		 m =w+m+12;
		 if(m%7==5)
		 printf("%d\n",i);
		m=0;
		}
	
}
int main()
{
	int i,a[12],w,s;
	s=0;
	scanf("%d",&w);
	a[0]=a[12]=0;
	for(i=1;i<12;i++){
		if(i==2)
			a[i]=28;
		else if(i==4||i==6||i==9||i==11)
			a[i]=30;
		else
			a[i]=31;}
	for(i=0;i<12;i++){
		s=s+a[i];
		if((s+w)%7==0)
			printf("%d\n",i+1);}
	return 0;
}
void search(int w)
{
	int a[12]={12,43,71,102,132,163,193,224,255,285,316,346};
	int b[12];
	int num=0,i,j,k;
	for(i=0;i<12;i++)
	{
		k=(w+a[i])%7;
		if (k==5)
		{
			j=i+1;
			b[num]=j;
			num++;
			
		}
	}
	
	for(i=0;i<num;i++)
	{
		if(i==num-1)
			printf("%d",b[i]);
		else printf("%d\n",b[i]);
	}
}






void main()
{
	int w;
	scanf("%d",&w);
    search(w); 
}
int main ()
{
    int w;
    scanf("%d",&w);
    w=w+12;
    for(;w>7;)
    w=w-7;
    if(w==5)
    printf("%d\n",1);
    w=w+31;
    for(;w>7;)
    w=w-7;
    if(w==5)printf("%d\n",2);
    w=w+28;
    for(;w>7;)
    w=w-7;
    if(w==5)printf("%d\n",3);
    w=w+31;
    for(;w>7;)
    w=w-7;
    if(w==5)printf("%d\n",4);
    w=w+30;
    for(;w>7;)
    w=w-7;
    if(w==5)printf("%d\n",5);
    w=w+31;
    for(;w>7;)
    w=w-7;
    if(w==5)printf("%d\n",6);
    w=w+30;
    for(;w>7;)
    w=w-7;
    if(w==5)printf("%d\n",7);
    w=w+31;
    for(;w>7;)
    w=w-7;
    if(w==5)printf("%d\n",8);
    w=w+31;
    for(;w>7;)
    w=w-7;
    if(w==5)printf("%d\n",9);
    w=w+30;
    for(;w>7;)
    w=w-7;
    if(w==5)printf("%d\n",10);
    w=w+31;
    for(;w>7;)
    w=w-7;
    if(w==5)printf("%d\n",11);
    w=w+30;
    for(;w>7;)
    w=w-7;
    if(w==5)printf("%d\n",12);
    return 0;
}
int main(){
	int a[12];
	int n,i;
	scanf("%d",&n);
	a[0]=((13-1)%7+n)%7;
	a[1]=((13+31-1)%7+n)%7;
	a[2]=((13+28+31-1)%7+n)%7;
	a[3]=((13+28+31+31-1)%7+n)%7;
	a[4]=((13+28+31+31+30-1)%7+n)%7;
	a[5]=((13+28+31+31+30+31-1)%7+n)%7;
	a[6]=((13+31+28+31+30+31+30-1)%7+n)%7;
	a[7]=((13+31+28+31+30+31+30+31-1)%7+n)%7;
	a[8]=((13+31+28+31+30+31+30+31+31-1)%7+n)%7;
	a[9]=((13+31+28+31+30+31+30+31+31+30-1)%7+n)%7;
	a[10]=((13+31+28+31+30+31+30+31+31+30+31-1)%7+n)%7;
	a[11]=((13+31+28+31+30+31+30+31+31+30+31+30-1)%7+n)%7;
	for(i=0;i<12;i++){
		if(a[i]==5)
			printf("%d\n",i+1);
	}
	return 0;
}
// ?????.cpp : ??????????????
//




int main()
{
	int w,k,month,daysum = 0,a[13],i=0;
	cin >> w;
	for (month = 1;month <= 12;month++)
	{
		if ((daysum + 13) % 7 == (13 - w) % 7)
		{
			a[i] = month;
			i++;
		}
		if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)
		{
			daysum = daysum + 31;
		}
		if (month == 4 || month == 6 || month == 9 || month == 11)
		{
			daysum = daysum + 30;
		}
		if (month == 2)
		{
			daysum = daysum + 28;
		}
	}
	for (k=0;k<=i-1;k++)
	{
		cout << a[k] << endl;
	}
	return 0;
}
int main()
{
	int w;

	scanf("%d",&w);

	if((13-1+w)%7==5) printf("1\n");
	if((44-1+w)%7==5) printf("2\n");
	if((72-1+w)%7==5) printf("3\n");
	if((103-1+w)%7==5) printf("4\n");
	if((133-1+w)%7==5) printf("5\n");
	if((164-1+w)%7==5) printf("6\n");
	if((194-1+w)%7==5) printf("7\n");
	if((225-1+w)%7==5) printf("8\n");
	if((256-1+w)%7==5) printf("9\n");
	if((286-1+w)%7==5) printf("10\n");
	if((317-1+w)%7==5) printf("11\n");
	if((347-1+w)%7==5) printf("12\n");

	return 0;

}
int main()
{
    int a[12]={0,31,59,90,120,151,181,212,243,273,304,334};
    int i,j,w;
    scanf("%d",&w);
    for(i=0;i<=11;i++)
    {
        if((a[i]+13-1+w)%7==5)
        printf("%d\n",i+1);
    }
    return 0;
}
int main()
{
    int n;
    cin>>n;
    switch(n)
    {case 1:cout<<4<<endl<<7<<endl;break;
     case 2:cout<<9<<endl<<12<<endl;break;
     case 3:cout<<6<<endl;break;
     case 4:cout<<2<<endl<<3<<endl<<11<<endl;break;
     case 5:cout<<8<<endl;break;
     case 6:cout<<5<<endl;break;
     case 7:cout<<1<<endl<<10<<endl;break;
     }
    return 0;
}
int main()
{
	int w;
	scanf("%d",&w);
	if((13-8+w)%7==5)
	{
		printf("1\n");
	}
		if((13+31-8+w)%7==5)
	{
		printf("2\n");
	}
    	if((13+31+28-8+w)%7==5)
	{
		printf("3\n");
	}	if((13+31+28+31-8+w)%7==5)
	{
		printf("4\n");
	}	if((13+31+28+31+30-8+w)%7==5)
	{
		printf("5\n");
	}if((13+31+28+31+30+31-8+w)%7==5)
	{
		printf("6\n");
	}if((13+31+28+31+30+31+30-8+w)%7==5)
	{
		printf("7\n");
	}if((13+31+28+31+30+31+30+31-8+w)%7==5)
	{
		printf("8\n");
	}if((13+31+28+31+30+31+30+31+31-8+w)%7==5)
	{
		printf("9\n");
	}
	if((13+31+28+31+30+31+30+31+31+30-8+w)%7==5)
	{
		printf("10\n");
	}
	if((13+31+28+31+30+31+30+31+31+30+31-8+w)%7==5)
	{
		printf("11\n");
	}if((13+31+28+31+30+31+30+31+31+30+31+30-8+w)%7==5)
	{
		printf("12\n");
	}
	return 0;
}
int main()
{
	int w;
    scanf("%d",&w);
	if(12%7+w>7)
	{
		if((12%7+w-7)==5)
		printf("1\n");
	}
	else {
		if(12%7+w==5)
        	printf("1\n");
	}
		if((12+31)%7+w>7)
	{
		if(((12+31)%7+w-7)==5)
		printf("2\n");
	}
	else {
		if((12+31)%7+w==5)
        	printf("2\n");
	}
		if((12+31+28)%7+w>7)
	{
		if(((12+31+28)%7+w-7)==5)
		printf("3\n");
	}
	else {
		if((12+31+28)%7+w==5)
        	printf("3\n");
	}
		if((12+31+28+31)%7+w>7)
	{
		if(((12+31+28+31)%7+w-7)==5)
		printf("4\n");
	}
	else {
		if((12+31+28+31)%7+w==5)
        	printf("4\n");
	}
		if((12+31+28+31+30)%7+w>7)
	{
		if(((12+31+28+31+30)%7+w-7)==5)
		printf("5\n");
	}
	else {
		if((12+31+28+31+30)%7+w==5)
        	printf("5\n");
	}
		if((12+31+28+31+30+31)%7+w>7)
	{
		if(((12+31+28+31+30+31)%7+w-7)==5)
		printf("6\n");
	}
	else {
		if((12+31+28+31+30+31)%7+w==5)
        	printf("6\n");
	}
		if((12+31+28+31+30+31+30)%7+w>7)
	{
		if(((12+31+28+31+30+31+30)%7+w-7)==5)
		printf("7\n");
	}
	else {
		if((12+31+28+31+30+31+30)%7+w==5)
        	printf("7\n");
	}
		if((12+31+28+31+30+31+30+31)%7+w>7)
	{
		if(((12+31+28+31+30+31+30+31)%7+w-7)==5)
		printf("8\n");
	}
	else {
		if((12+31+28+31+30+31+30+31)%7+w==5)
        	printf("8\n");
	}
		if((12+31+28+31+30+31+30+31+31)%7+w>7)
	{
		if(((12+31+28+31+30+31+30+31+31)%7+w-7)==5)
		printf("9\n");
	}
	else {
		if((12+31+28+31+30+31+30+31+31)%7+w==5)
        	printf("9\n");
	}
		if((12+31+28+31+30+31+30+31+31+30)%7+w>7)
	{
		if(((12+31+28+31+30+31+30+31+31+30)%7+w-7)==5)
		printf("10\n");
	}
	else {
		if((12+31+28+31+30+31+30+31+31+30)%7+w==5)
        	printf("10\n");
	}
		if((12+31+28+31+30+31+30+31+31+30+31)%7+w>7)
	{
		if(((12+31+28+31+30+31+30+31+31+30+31)%7+w-7)==5)
		printf("11\n");
	}
	else {
		if((12+31+28+31+30+31+30+31+31+30+31)%7+w==5)
        	printf("11\n");
	}
		if((12+31+28+31+30+31+30+31+31+30+31+30)%7+w>7)
	{
		if(((12+31+28+31+30+31+30+31+31+30+31+30)%7+w-7)==5)
		printf("12\n");
	}
	else {
		if((12+31+28+31+30+31+30+31+31+30+31+30)%7+w==5)
        	printf("12\n");
	}
}
int main()
{
	int w,i,j,n,a[12][2];
	cin>>w;
	a[0][0]=w;
	for (i=0;i<12;i++)
	{
		if (i==0 || i==2 || i==4 || i==6 || i==7 || i==9 || i==11) n=31;
		else if (i==1 ) n=28;
		     else n=30;
		a[i][1]=a[i][0]+12;
		a[i+1][0]=a[i][0]+n;
		if (a[i][1] % 7==5) 
			cout<<i+1<<endl;
	}
	return 0;
}
int main()
{
	int i,w;
	scanf("%d",&w);

	for(i=1;i<=365;i++)
	{
		if(i%7+w==13||i%7+w==6)
		{
			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 a,b,c;
scanf("%d",&a);


if ((12+a)%7==5)
printf("1\n");
if ((43+a)%7==5)
printf("2\n");
if ((71+a)%7==5)
printf("3\n");
if ((102+a)%7==5)
printf("4\n");
if ((132+a)%7==5)
printf("5\n");
if ((163+a)%7==5)
printf("6\n");
if ((193+a)%7==5)
printf("7\n");
if ((224+a)%7==5)
printf("8\n");
if ((255+a)%7==5)
printf("9\n");
if ((285+a)%7==5)
printf("10\n");
if ((316+a)%7==5)
printf("11\n");
if ((346+a)%7==5)
printf("12\n");


}
int main()
{
int w,a[12],i,b[12];
scanf("%d",&w);
if(w<3) w=w+5;
else w=w-2;
    a[0]=7;
a[1]=a[3]=a[5]=a[7]=a[8]=a[10]=31;
    a[4]=a[6]=a[9]=a[11]=30;
a[2]=28;
for(i=2;i<=11;i++){
     a[i]+=a[i-1];
}

     for(i=0;i<=11;i++){
     if(a[i]%7+w==5||a[i]%7+w==12)
b[i]=i+1;
else b[i]=0;

}
for(i=0;i<=11;i++){
if(b[i]!=0)
printf("%d\n",b[i]);
}
return 0;
}
int main()
{
	int w,t=0,a;
	int month_days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d",&w);
	for (int i=1;i<=12;i++)
	{
		t+=month_days[i-1];
		a=t+w+12;
		if(a%7==5)
		{
			printf("%d\n",i);
		}

	}
	return 0;

}
main()
{int a[12],i,b,w;
scanf("%d",&w);
a[1]=w+12;
a[2]=a[1]+3;
a[3]=a[2];
a[4]=a[3]+3;
a[5]=a[4]+2;
a[6]=a[5]+3;
a[7]=a[6]+2;
a[8]=a[7]+3;
a[9]=a[8]+3;
a[10]=a[9]+2;
a[11]=a[10]+3;
a[12]=a[11]+2;
i=1;
do{
	b=a[i]%7;
	if(b==5)
	{printf("%d\n",i);}
	i=i+1;}while(i<=11);
	b=a[9]%7;
	if(b==5)
	printf("12");
}
int main()
{
	int w,a,b,c;
	scanf("%d",&w);
	if((w+12)%7==5) printf("1\n");
	w=w+12;
	if((w+31)%7==5) printf("2\n");
	w=w+31;
	if((w+28)%7==5) printf("3\n");
	w=w+28;
	if((w+31)%7==5) printf("4\n");
	w=w+31;
	if((w+30)%7==5) printf("5\n");
	w=w+30;
	if((w+31)%7==5) printf("6\n");
	w=w+31;
	if((w+30)%7==5) printf("7\n");
	w=w+30;
	if((w+31)%7==5) printf("8\n");
	w=w+31;
	if((w+31)%7==5) printf("9\n");
	w=w+31;
	if((w+30)%7==5) printf("10\n");
	w=w+30;
	if((w+31)%7==5) printf("11\n");
	w=w+31;
	if((w+30)%7==5) printf("12\n");
	w=w+30;
	 
}
int main()
    {
		int a[13] = {0,0,3,3,6,1,4,6,2,5,0,3,5}, w, i, j, date, b[13] = {0};
		cin >> w;
		for (i = 1 ; i <= 12 ; i++)
		    {
				date = w + a[i] + 5;
		        for (j = 1 ; j >= 1 ; j++)
				    {
						if (date > 7)
							date-=7;
						else {
							    if (date == 5)
								{cout << i <<endl; break;}
						        else break;				
						     }
				    }
		    }
		return 0;
    }
int main(int argc, char* argv[])
{
	int w;
	scanf("%d",&w);
	int i;
	for(i=1;i<=12;i++){
		if((w+12)%7==5){
			printf("%d\n",i);
		}
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			w=w+31;
		}else if(i==2){
			w=w+28;
		}else{
			w=w+30;
		}
	}
	return 0;
}
int main()
{
	int w, k;
	int l;
	cin >> w;//???31???? w - 1?????
	switch(w)
	{
		case 2:
		case 3:
		case 4:
		case 5:
		case 6:
		case 7: k = w - 1;break;
		case 1: k = 7;break;
		default: break;
	}
	

	l = 13 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<'1' <<endl; 

	l = 44 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<'2' <<endl; 

	l = 72 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<'3' <<endl; 

	l = 103 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<'4' <<endl;

	l = 133 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<'5' <<endl;

	l = 164 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<'6' <<endl;

	l = 194 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<'7' <<endl;

	l = 225 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<'8' <<endl;

	l = 256 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<'9' <<endl;

	l = 286 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<"10" <<endl;

	l = 317 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<"11" <<endl;

	l = 347 % 7 + k;
	if(l > 7)l = l - 7;
	if(l == 5)cout <<"12"<<endl;

	return 0; 
}
int main()
{
    int m[12];
    m[0]=0;
    for(int i=1;i<12;i++)
    {
            if(i==2) m[i]=m[i-1]+28;
            else if(i<8&&i%2==1) m[i]=m[i-1]+31;
            else if(i>=8&&i%2==0) m[i]=m[i-1]+31;
            else m[i]=m[i-1]+30;
    }
    int w;
    cin>>w;
    for(int q=1;q<=12;q++)
      if((m[q-1]+13+w-1)%7==5) cout<<q<<endl;
}
int day(int w,int m)
{
	int n=0,a[11]={31,28,31,30,31,30,31,31,30,31,30},i;
	if(m>1){
		for(i=0;i<m-1;i++)
			n+=a[i];
	}
	n+=12;
	if((w+(n%7))%7==5)
		return 1;
	else
		return 0;
}

void main()
{
	int w,m;
	scanf("%d",&w);
	for(m=1;m<=12;m++){
		if(day(w,m))
			printf("%d\n",m);
	}
}
void main()
{
	int w,i;
	int day(int x);
	scanf("%d",&w);
	for(i=1;i<=12;i++)
	{
		if(w<=5)
		{
     if(day(i)%7==(5-w))
		 printf("%d\n",i);
		}
		else if(w==7)
		{
        if(day(i)%7==5)
		 printf("%d\n",i);
		}
		else
        if(day(i)%7==6)
		 printf("%d\n",i);
	}
}

int day(int x)
{
	int i,sum=0,a[12];
	if(x==1)
		sum=0;
	else
	{
	for(i=1;i<=(x-1);i++)
	{
		if(i==1)
			a[i]=31;
		else if(i==3||i==5||i==7||i==8||i==10||i==12)
			a[i]=31;
		else if(i==4||i==6||i==9||i==11)
			a[i]=30;
		else a[i]=28;
		sum=sum+a[i];
    }
	}
	return (sum+12);
}
int main()
{int w, i, d, t;
int a[12]={12,43,71,102,132,163,193,224,255,285,316,346};

scanf("%d",&w);
for(i=0, t=0;i<12;i++)
{
	d=a[i]%7+w;
	if(d>7)
	{d=d-7;}
	
	if(d==5)
	{
		if(t==0)
		{printf("%d\n",i+1);}
		else
		{printf("\n%d\n",i+1);}
	}
}
return 0;
}
main()
{
      int w;
      int mon[15];
      scanf("%d",&w);
      if((w+12)%7==5) printf("1\n");
      w=w+12;
      if((w+31)%7==5) printf("2\n");
      w=w+31;
      if((w+28)%7==5) printf("3\n");
      w=w+28;
      if((w+31)%7==5) printf("4\n");
      w=w+31;
      if((w+30)%7==5) printf("5\n");
      w=w+30;
      if((w+31)%7==5) printf("6\n");
      w=w+31;
      if((w+30)%7==5) printf("7\n");
      w=w+30;
      if((w+31)%7==5) printf("8\n");
      w=w+31;
      if((w+31)%7==5) printf("9\n");
      w=w+31;
      if((w+30)%7==5) printf("10\n");
      w=w+30;
      if((w+31)%7==5) printf("11\n");
      w=w+31;
      if((w+30)%7==5) printf("12\n");
      w=w+30;
   
      
      }
int main()
{
	int w;				//w????????????
	cin >> w;

	int w13 = (w + 12) % 7;			//??w13???????????
	int monthD[13] = {0,31,28,31,30,31,30,31,31,30,31,30,0};

	for (int month = 1;month <= 12;month ++)
	{
		if (w13 == 5)
			cout << month << endl;
		w13 += monthD[month];
		w13 = w13 % 7;
	}

	cin.get();
	cin.get();
	return 0;
}
//**********************
//* ??? ?????  *
//* ??? 1200012878  * 
//* 11?16?           *
//**********************
int main()
{
	int w, a[13] = {0}, b[13], i; // ????????????????????????????13???????????
	cin >> w;
	b[0] = w + 12; 
	for (i = 1; i <= 12; i++)
	{
		if (i == 2)
			a[i] = 0;
		else
			if (i == 4 || i == 6 || i== 9 ||i == 11)
				a[i] = 2;
			else
				a[i] = 3;
	} // ????????????????????
	for (i = 1; i <= 12; i++)
	{
		b[i] = b[i - 1] + a[i - 1];
		if (b[i] % 7 == 5)
			cout << i << endl;
	}  // ??????13??????????5??????
	return 0;
}
int main()
 { 
	int x,i,date,day;
	scanf("%d",&x);
	for(i=0;i<12;i++)
	{
        if (i==0) date=13;
		else if(i==4||i==6||i==9||i==11) date+=30;
		else if(i==2) date+=28;
		else date+=31;
		day=(date+x-1)%7;
		if (day==5) printf("%d\n",i+1);
	}
  return 0; 
}
int main()
{
	int w,firstfri,interval,i;
	scanf("%d",&w);
	if(w<=5)
		firstfri=6-w;
	else if(w>5) firstfri=13-w;
	interval=13-firstfri;
	for(i=1;i<=12;i++)
	{
		if(i==1) if(interval%7==0) printf("%d\n",i);
		if(i==2||i==4||i==6||i==8||i==9||i==11)
		{
			interval+=31;
			if(interval%7==0) printf("%d\n",i);
		}
		if(i==3) 
		{
			interval+=28;
			if(interval%7==0)
				printf("%d\n",i);
		}
		if(i==5||i==7||i==10||i==12)
		{
			interval+=30;
			if(interval%7==0)
				printf("%d\n",i);
		}
	}
	return 0;
}
main()
{
      int i,j,w;
      scanf("%d",&w);
      int a[12];
      a[0]=13;
      for(i=1;i<=11;i++)
      {
                        if(i==1||i==3||i==5||i==7||i==8||i==10)
                        a[i]=a[i-1]+31;
                        else if(i==2)
                        a[i]=a[i-1]+28;
                        else 
                        a[i]=a[i-1]+30;
      }
      if(w<=5)
      {
      for(i=0;i<=11;i++)
      {j=6-w;
      if((a[i]-j)%7==0)
      printf("%d\n",i+1);
      }      
      }
      else
      {for(i=0;i<=11;i++)
      {j=13-w;
      if((a[i]-j)%7==0)
      printf("%d\n",i+1);
      }
      } 
     
      }
int main()
{
	int w,i=0;
	scanf("%d",&w);
    if(w+5==12){
		printf("1\n");
	}
	w=w+3;
	if(w==7){
		printf("2\n");}
	if(w>7){
		w=w-7;
	}
	if(w==7){
		printf("3\n");}
	if(w>7){
		w=w-7;
	}
	w=w+3;
	if(w==7){
		printf("4\n");}
	if(w>7){
		w=w-7;
	}
	w=w+2;
	if(w==7){
		printf("5\n");}
	if(w>7){
		w=w-7;
	}
	w=w+3;
	if(w==7){
		printf("6\n");}
	if(w>7){
		w=w-7;
	}
	w=w+2;
    if(w==7){
		printf("7\n");}
	if(w>7){
		w=w-7;
	}
	w=w+3;
    if(w==7){
		printf("8\n");}
	if(w>7){
		w=w-7;
	}
	w=w+3;
	if(w==7){
		printf("9\n");}
	if(w>7){
		w=w-7;
	}
	w=w+2;
    if(w==7){
		printf("10\n");}
	if(w>7){
		w=w-7;
	}
	w=w+3;
	if(w==7){
		printf("11\n");}
	if(w>7){
		w=w-7;
	}
	w=w+2;
    if(w==7){
		printf("12\n");}
	if(w>7){
		w=w-7;
	}
	return 0;
}
void main()
{ int w,a[365],b[365],c[12]={31,28,31,30,31,30,31,31,30,31,30,31};
  int i,j,m;
  scanf("%d",&w);
  for(i=0;i<365;i=i+1)
	  a[i]=(w+i)%7;
  
  for(i=0;i<365;i++)
  b[i]=0;
  
  b[12]=1;
  for(i=0,m=12;i<12;i++)
  {m=m+c[i];
   b[m]=1;}
  for(i=0;i<365;i++)
  {if(a[i]==5&&b[i]==1)
    printf("%d\n",i/31+1);}
}
void main()
{
    int w,day,mon;
	int cal(int mon);
	scanf("%d",&w);
	for(mon=1;mon<13;mon++)
	{
	    day=cal(mon);
		if((day+w)%7==5)printf("%d\n",mon);
	}
}
int cal(int mon)
{
   int total=0;
   if(mon>1)total+=31;
   if(mon>2)total+=28;
   if(mon>3)total+=31;
   if(mon>4)total+=30;
   if(mon>5)total+=31;
   if(mon>6)total+=30;
   if(mon>7)total+=31;
   if(mon>8)total+=31;
   if(mon>9)total+=30;
   if(mon>10)total+=31;
   if(mon>11)total+=30;
   total=total+12;
   return(total);
}
void main()
{
	int w;
	scanf("%d",&w);
	if((w+12)%7==5)    printf("1\n");
	if((w+43)%7==5)    printf("2\n");
	if((w+71)%7==5)    printf("3\n");
	if((w+102)%7==5)    printf("4\n");
	if((w+132)%7==5)    printf("5\n");
	if((w+163)%7==5)    printf("6\n");
    if((w+193)%7==5)    printf("7\n");
	if((w+224)%7==5)    printf("8\n");
	if((w+255)%7==5)    printf("9\n");
	if((w+285)%7==5)    printf("10\n");
	if((w+316)%7==5)    printf("11\n");
	if((w+346)%7==5)    printf("12\n");
}
int main()
{
    int w;
    int week[11];
    int i;
    scanf("%d", &w);
    week[0]=w;
    week[1]=(week[0]+3)%7;
    week[2]=week[1];
    week[3]=(week[2]+3)%7;
    week[4]=(week[3]+2)%7;
    week[5]=(week[4]+3)%7;
    week[6]=(week[5]+2)%7;
    week[7]=(week[6]+3)%7;
    week[8]=(week[7]+3)%7;
    week[9]=(week[8]+2)%7;
    week[10]=(week[9]+3)%7;
    week[11]=(week[10]+2)%7;
    for(i=0;i<12;i++)
    {
        if(week[i]==0)
            week[i] = week[i] + 7;
    }
    for(i=0;i<12;i++)
    {
        if(week[i]==7)
            printf("%d\n", i+1);
    }
	return 0;
}
int main(int argc, char* argv[])
{
 int s=0,w,m[12]={31,28,31,30,31,30,31,31,30,31,30,31};
 scanf("%d",&w);
 int i,j;
 if(w==7)
	printf("1\n");
 for(i=1;i<12;i++)
 {
 for(j=0;j<i;j++)
 {
 s=s+m[j];}
 s=s+13;
 if((s+w-1)%7==5)
	{ printf("%d\n",i+1);}
 s=0;}
	return 0;
}
int main()
{ 
	int days_within_a_year(int a,int b);
	int week11,week,i;
	scanf("%d",&week11);
	for(i=0;i<12;i++)
	{
		week=(days_within_a_year(i+1,13)+week11)%7;
		if(week==5)
			printf("%d\n",i+1);
	}
	return 0;
 
}
int days_within_a_year(int a,int b)
{
	int n,d;	
	switch(a)
	{
		case 1:n=0;break;
		case 2:n=31;break;
		case 3:n=31+28;break;
		case 4:n=31+28+31;break;
		case 5:n=31+28+31+30;break;
		case 6:n=31+28+31+30+31;break;
		case 7:n=31+28+31+30+31+30;break;
		case 8:n=31+28+31+30+31+30+31;break;
		case 9:n=31+28+31+30+31+30+31+31;break;
		case 10:n=31+28+31+30+31+30+31+31+30;break;
		case 11:n=31+28+31+30+31+30+31+31+30+31;break;
		case 12:n=31+28+31+30+31+30+31+31+30+31+30;break;
	}
	d=n+b-1;
	return(d);
}
int main()
{
    int w,a[12],x;
    cin>>w;
    a[0]=a[9]=w+5;
    a[1]=a[2]=a[10]=w+1;
    a[3]=a[6]=w+4;
    a[4]=w+6;
    a[7]=w;
    a[8]=a[11]=w+3;
    a[5]=w+2;
    for(int i=0;i<12;i++)
        {
            x=i+1;
            if(a[i]%7==5) cout<<x<<endl;
        }
    return 0;
}
int main()
{   int w,k,p[13],i;
cin>>w;
    switch(w)
	{ case 1:k=5;break;
	case 2:k=4;break;
		case 3:k=3;break;
			case 4:k=2;break;
				case 5:k=1;break;
				case 6:k=7;break;
				case 7:k=6;break;}
	p[0]=0;
	p[1]=13;
	p[2]=13+31;
	p[3]=13+31+28;
	p[4]=13+31+28+31;
	p[5]=13+31+28+31+30;
	p[6]=13+31+28+31+30+31;
	p[7]=13+31+28+31+30+31+30;
	p[8]=13+31+28+31+30+31+30+31;
	p[9]=13+31+28+31+30+31+30+31+31;
	p[10]=13+31+28+31+30+31+30+31+31+30;
    p[11]=13+31+28+31+30+31+30+31+31+30+31;
	p[12]=13+31+28+31+30+31+30+31+31+30+31+30;
	for(i=1;i<=12;i++)
	{ if((p[i]-k)%7==0) cout<<i<<endl;}
	




	return 0;
}
int main(){
    int w;
    cin>>w;
    for(int i=1;i<=12;i++){
        if((w+12)%7==5) cout<<i<<endl;
        if(i==1||i==3||i==5||i==7||i==8||i==10||i==12) w+=31;
        if(i==2) w+=28;
        if(i==4||i==6||i==9||i==11) w+=30;       
    }
    return 0;
    }
void main()
{
    int a[13],w,i;
    scanf("%d",&w);
    a[1]=13;
    a[2]=a[1]+31;
    a[3]=a[2]+28;
    a[4]=a[3]+31;
    a[5]=a[4]+30;
    a[6]=a[5]+31;
    a[7]=a[6]+30;
    a[8]=a[7]+31;
    a[9]=a[8]+31;
    a[10]=a[9]+30;
    a[11]=a[10]+31;
    a[12]=a[11]+30;
    for(i=1;i<=12;i++)
    {
    	if((a[i]%7-1+w)==5||(a[i]%7-1+w)==12)
    	printf("%d\n",i);
    }
}
int main(){
    int w,i;
	int md[12]={31,28,31,30,31,30,31,31,30,31,30,31},mzs[12],shis[12];
	scanf("%d",&w);
	mzs[0]=31;
	for(i=1;i<12;i++) mzs[i]=mzs[i-1]+md[i];
	shis[0]=13-1;
	for(i=1;i<12;i++) shis[i]=mzs[i-1]+13-1;
	for(i=0;i<12;i++) {
		if(shis[i]%7==0&&w==5) printf("%d\n",i+1);
		else if(shis[i]%7==1&&w==4) printf("%d\n",i+1);
		else if(shis[i]%7==2&&w==3) printf("%d\n",i+1);
		else if(shis[i]%7==3&&w==2) printf("%d\n",i+1);
		else if(shis[i]%7==4&&w==1) printf("%d\n",i+1);
		else if(shis[i]%7==5&&w==7) printf("%d\n",i+1);
		else if(shis[i]%7==6&&w==6) printf("%d\n",i+1);
	}
	return 0;
}