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

int main()
{
	int day;
	scanf("%d",&day);

	day=6-day;
	if(day<=0)
	{day=day+7;}

	int sum=0;
	int i;
	for(i=1;i<=12;i++)
	{
		if((sum+13-day)%7==0)
		{
			printf("%d\n",i);
		}
		sum=sum+sz[i];
	}
	return 0;
}
int main()
{
    int day_of_month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    int w;
    int i , days=13 ;
    scanf("%d" , &w);
    if(w==5)
      {
         for(i=1 ; i<13 ; i++)
            {
               days=day_of_month[i-1]+days;
               if( (days-1)%7==0 ) printf("%d\n" , i);
             }
       }
    if(w==1)
      {
         for(i=1 ; i<13 ; i++)
            {
               days=day_of_month[i-1]+days;
               if( (days-5)%7==0 ) printf("%d\n" , i);
             }
       }

    if(w==2)
      {
         for(i=1 ; i<13 ; i++)
            {
               days=day_of_month[i-1]+days;
               if( (days-4)%7==0 ) printf("%d\n" , i);
             }
       }
     if(w==3)
      {
         for(i=1 ; i<13 ; i++)
            {
               days=day_of_month[i-1]+days;
               if( (days-3)%7==0 ) printf("%d\n" , i);
             }
       }
    if(w==4)
      {
         for(i=1 ; i<13 ; i++)
            {
               days=day_of_month[i-1]+days;
               if( (days-2)%7==0 ) printf("%d\n" , i);
             }
       }
     if(w==6)
      {
         for(i=1 ; i<13 ; i++)
            {
               days=day_of_month[i-1]+days;
               if( (days-7)%7==0 ) printf("%d\n" , i);
             }
       }
     if(w==7)
      {
         for(i=1 ; i<13 ; i++)
            {
               days=day_of_month[i-1]+days;
               if( (days-6)%7==0 ) printf("%d\n" , i);
             }
       }
     return 0;
}
int DJT(int m){
	int i,result=0;
	for(i=1;i<m;i++){
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
		result+=31;
		}else if(i==4||i==6||i==9||i==11){
		result+=30;
		}else{ 
		result+=28;
		}
	}
    result+=13;
	return result;
}
int DJT(int m);
int main()
{
    int w,i,m=0;
	scanf("%d",&w);
	for(i=1;i<13;i++){
		m=DJT(i)%7;
		if((w==1&&m==5)||(w==2&&m==4)||(w==3&&m==3)||(w==4&&m==2)||(w==5&&m==1)||(w==6&&m==0)||(w==7&&m==6)){
			printf("%d\n",i);
		}
	}
return 0;
}
int main() 
{
	int w,i,k;
	scanf("%d",&w);
	if(w%N==0)
	printf("1\n");
	if((w+3)%N==0)
	printf("2\n3\n");
	if((w+6)%N==0)
	printf("4\n");
	if((w+8)%N==0)
	printf("5\n");
	if((w+11)%N==0)
	printf("6\n");
	if((w+13)%N==0)
	printf("7\n");
	if((w+16)%N==0)
	printf("8\n");
	if((w+19)%N==0)
	printf("9\n");
	if((w+21)%N==0)
	printf("10\n");
	if((w+24)%N==0)
	printf("11\n");
	if((w+26)%N==0)
	printf("12\n");
}
int main() {
	int w;
	scanf("%d",&w);
	int month[12]={0,31,28,31,30,31,30,31,31,30,31,30};
	int ts[12];
	ts[0]=13;
	int i,j;
	for(i=1;i<12;i++){
		ts[i]=ts[i-1]+month[i];
	}
	int dygzw;
	if(w==5){
		dygzw=1;
	}else if(w<5){
		dygzw=1+(5-w);
	}else if(w==6){
		dygzw=7;
	}else{
		dygzw=6;
	}
	int syzw[53];
	int m=1;
	syzw[0]=dygzw;
	for(i=1;i<53;i++){
		syzw[i]=syzw[i-1]+7;
		if(syzw[i]<=365){
			m++;
		}else{
			break;
		}
	}
	int k;
	k=0;
	for(i=0;i<m;i++){
		for(j=0;j<12;j++){
			if(syzw[i]==ts[j]){
				printf("%d\n",j+1);
				k++;
			}
		}
	}
	if(k==0){
		printf("empty");
	}
	return 0;
}
int mon(int m){
    int y ;
    if( m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12 ) y = 31 ;
    else if( m == 2 ) y = 28 ;
    else y = 30 ;
    return(y);
}

int main(){
    int w , ww , i = 13 , m ;
    scanf("%d" , &w );
    for( m = 1 ; m <= 12 ; m = m + 1 ){
        ww = ( i - 1 + w ) % 7;
        if ( ww == 5 ) printf("%d\n" , m );
        i = i + mon(m);
    }
    return(0);
}
int yue(int a);
int main()
{
	int w,i;
	scanf("%d",&w);
	for(i=1;i<=12;i++){
		if(w==7){
			printf("%d\n",i);
		}
		w+=yue(i)%7;
		if(w>7)
			w-=7;
	}
	return 0;
}
int yue(int a){
	if(a==1||a==3||a==5||a==7||a==8||a==10||a==12)
		return 31;
	else if(a==2)
		return 28;
	else
		return 30;
}
int tianshu(int i)
{
	switch(i)
	{
	case 1:
		return 13;
	case 2:
		return 13+31;
	case 3:
		return 31+28+13;
	case 4:
		return 31+28+31+13;
	case 5:
		return 31+28+31+30+13;
	case 6:
		return 31+28+31+30+13+31;
	case 7:
		return 31+28+31+30+13+31+30;
	case 8:
		return 31+28+31+30+13+31+30+31;
	case 9:
		return 31+28+31+30+13+31+30+31+31;
	case 10:
		return 31+28+31+30+13+31+30+31+31+30;
	case 11:
		return 31+28+31+30+13+31+30+31+31+30+31;
	case 12:
		return 31+28+31+30+13+31+30+31+31+30+31+30;
	}
}

int main()
{
	int w,i,x;
	scanf("%d",&w);
	for(i=1;i<=12;i++)
	{
		x=tianshu(i);
		if(((x-1)%7+w)%7==5)
			printf("%d\n",i);
	}
	return 0;
}
void main()
{
int i,n,a[12];
	scanf("%d",&n);
	a[0]=12;
	for(i=1;i<12;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;
	}
	for(i=0;i<12;i++)
	{
		if((a[i]+n)%7==5)printf("%d\n",i+1);
	}
}
int main(){
	int w,d=1;
	scanf("%d",&w);
	if (w==1)
		d=5;
	if (w==2) 
		d=4;
	if (w==3)
		d=3;
	if (w==4)
		d=2;
	if (w==6)
		d=7;
	if (w==7)
		d=6;
	if ((13-d)%7==0)
		printf("1\n");
	if ((44-d)%7==0)
		printf("2\n");
	if ((72-d)%7==0)
		printf("3\n");	
	if ((103-d)%7==0)
		printf("4\n");
	if ((133-d)%7==0)
		printf("5\n");
	if ((164-d)%7==0)
		printf("6\n");
	if ((194-d)%7==0)
		printf("7\n");	
	if ((225-d)%7==0)
		printf("8\n");
	if ((256-d)%7==0)
		printf("9\n");
	if ((286-d)%7==0)
		printf("10\n");
	if ((317-d)%7==0)
		printf("11\n");
	if ((347-d)%7==0)
		printf("12\n");	
	return 0;
}
int main()
{
	int mon[12]={0,31,28,31,30,31,30,31,31,30,31,30};
	int imon[12]={0};
	int w;
	cin>>w;
	int i;
	int j = 0;
	int d,id=0;
	int s = 0;
	switch(w)
	{
		case 7:s = 5;break;
		case 6:s = 6;break;
		case 5:s = 0;break;
		case 4:s = 1;break;
		case 3:s = 2;break;
		case 2:s = 3;break;
		default:s = 4;break;
	}
	for(i = 0;i < 12;i++)
	{
		id += mon[i];
		d = id + 13 - 1;
		if((d % 7) == s)
		{
			imon[j]=i+1;
			j++;
		}
	}
	for(i=0;i<j;i++)
		cout<<imon[i]<<endl;
	return 0;
}
int main(int argc, char *argv[])
{ int tianshu[13]={0,31,59,90,120,151,181,212,243,273,304,334,365};
  int i,n,m,xinqi;
  scanf("%d",&xinqi);
  for(i=0;i<12;i++){
       if((tianshu[i]+12+xinqi)%7==5)
          printf("%d\n",i+1);             }
  
    
  
  return 0;
}
int main(){
     	int w,xingqi;
	  scanf("%d",&w);
      xingqi=(13%7-1+w)%7;
	  if(xingqi==5){
	     printf("1\n");
	  }
	  xingqi=(44%7+w-1)%7;
	  if(xingqi==5){
	     printf("2\n");
	  }xingqi=(72%7+w-1)%7;
	  if(xingqi==5){
	     printf("3\n");
	  }xingqi=(103%7+w-1)%7;
	  if(xingqi==5){
	     printf("4\n");
	  }xingqi=(133%7+w-1)%7;
	  if(xingqi==5){
	     printf("5\n");
	  }xingqi=(164%7+w-1)%7;
	  if(xingqi==5){
	     printf("6\n");
	  }xingqi=(194%7+w-1)%7;
	  if(xingqi==5){
	     printf("7\n");
	  }xingqi=(225%7+w-1)%7;
	  if(xingqi==5){
	     printf("8\n");
	  }xingqi=(256%7+w-1)%7;
	  if(xingqi==5){
	     printf("9\n");
	  }xingqi=(286%7+w-1)%7;
	  if(xingqi==5){
	     printf("10\n");
	  }xingqi=(317%7+w-1)%7;
	  if(xingqi==5){
	     printf("11\n");
	  }xingqi=(347%7+w-1)%7;
	  if(xingqi==5){
	     printf("12\n");
	  }
	  
	   
	  
     return 0;
}
void main()
{
	int n,a,i,j;
	int y[12];
	int re[12];
	y[0]=13,y[1]=44,y[2]=72,y[3]=103,y[4]=133,y[5]=164,y[6]=194,y[7]=225,y[8]=256,y[9]=286,y[10]=317,y[11]=347;
	re[0]=0;
	scanf("%d",&n);
    a=(7-n+1+5);
	for(j=0,i=0;i<12;i++)
	{
		if(((y[i]-a)%7)==0)
		{re[j]=(i+1);j=j+1;}
	}
	if(re[0]==0){}
	else
	{
	 for(i=0;i<j;i++)
	
		 printf("%d\n",re[i]);
     
	}
}
int main ()
{
    int w;
	cin >> w;
	switch (w % 7)
	{
	    case 0:cout << 1 << endl << 10;break;
		case 1:cout << 4 << endl << 7;break;
		case 2:cout << 9 << endl << 12;break;
		case 3:cout << 6;break;
		case 4:cout << 2 << endl << 3 << endl << 11;break;
		case 5:cout << 8;break;
		case 6:cout << 5;break;
	}
    return 0;
}
int main()
{
    int w,i,t;
	int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>w;
	for(i=0;i<12;i++)
	{
        t=w+12;
	    t=t%7;
		if(t==0) t=7;
		else t=t;
		if(t==5) 
		{
			cout<<i+1<<endl;
		}
		w=w+a[i]-1;
		w=w%7+1;
	}
	return 0;
}
main()
{
      int w;
      scanf("%d",&w);
      
      int day[13];
      
      day[1]=31;
       day[2]=28;
        day[3]=31;
         day[4]=30;
          day[5]=31;
           day[6]=30;
            day[7]=31;
             day[8]=31;
              day[9]=30;
               day[10]=31;
                day[11]=30;
                 day[12]=31; 
      
for (int i=1;i<=12;i++)
     {  
         
         if ((13+w-1)%7==5)printf("%d\n",i);
         w=(w+day[i])%7;
     }
      
 }
int main(){
int i,j,w,day,rq[31];
scanf("%d",&w);
for(i=1;i<=12;i++){
	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;
	}
	for(j=0;j<day;j++){
		if(w<=7){
			rq[j]=w;
			w++;
		}
		else{
			w=w-7;
			rq[j]=w;
			w++;
		
		}
	}
        if(rq[12]==5){
			printf("%d\n",i);
      
		}
	
}
return 0;
}
void main()
{
	int i,j,k,n,m[13]={0},w;
	char s[1000]={""};
	scanf("%d",&w);
    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(i=1;i<=12;i++)
	{if(m[i]%7==5) printf("%d\n",i);}

	

}
int main()
{
	int a[13];
	a[1]=12;
	a[2]=43;
	a[3]=71;
	a[4]=102;
	a[5]=132;
	a[6]=163;
	a[7]=193;
	a[8]=224;
	a[9]=255;
	a[10]=285;
	a[11]=316;
	a[12]=346;
	int w,i;
	scanf("%d",&w);
	for(i=1;i<=12;i++)
	{
		if((a[i]+w)%7==5)
		{
			printf("%d\n",i);
		}
	}
	return 0;
}
int date(int);
int main()
{
	int w, W;
	cin >> w;
	if(w <= 5)
		W = 5 - w;
	else
		W = 12 - w;
	for(int j = 1; j <= 12; j++)
	{
		if(date(j) % 7 == W)
			cout << j << endl;
	}
	return 0;
}
int date(int cf)
{
	int sum, month[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
	if(cf == 1)
		sum = 12;
	else
	{
		sum = 43;
		for(int i = 2; i < cf; i++)
			sum = sum + month[i];
	}
	return sum;
}
void main(){
	int date[365];
	int month[13];
	int primary,i;
	scanf("%d",&primary);
	for (i=0;i<=365;i++)
		date[i]=((i+primary)%7);
	if (date[12]==5) month[1]=1;
	if (date[43]==5) month[2]=1;
	if (date[71]==5) month[3]=1;
	if (date[102]==5) month[4]=1;
	if (date[132]==5) month[5]=1;
	if (date[163]==5) month[6]=1;
	if (date[193]==5) month[7]=1;
	if (date[224]==5) month[8]=1;
	if (date[255]==5) month[9]=1;
	if (date[285]==5) month[10]=1;
	if (date[316]==5) month[11]=1;
	if (date[346]==5) month[12]=1;
	for (i=1;i<=12;i++)
		if (month[i]==1) printf("%d\n",i);
}
int main()
{
	int a[365],w,i,j=0,b[12];
	cin>>w;
	for(i=0;i<365;i++)
	a[i]=i+w;
	b[0]=a[12];
	b[1]=a[12+31];
	b[2]=a[12+31+28];
	b[3]=a[12+31*2+28];
	b[4]=a[12+31*2+30+28];
	b[5]=a[12+31*3+30+28];
	b[6]=a[12+31*3+30*2+28];
	b[7]=a[12+31*4+30*2+28];
	b[8]=a[12+31*5+30*2+28];
	b[9]=a[12+31*5+30*3+28];
	b[10]=a[12+31*6+30*3+28];
	b[11]=a[12+31*6+30*4+28];
	for(i=0;i<12;i++)
	{
		if(b[i]%7==5&&j==0) {cout<<i+1;j++;continue;}
		if(b[i]%7==5&&j!=0) 
		{
			cout<<endl<<i+1;
		}
	}
	return 0;
}
int main()
{
	int w,s[13];
	scanf("%d",&w);
	s[1]=(w+12)%7;
	s[2]=(s[1]+31)%7;
	s[3]=(s[2]+28)%7;
	s[4]=(s[3]+31)%7;
	s[5]=(s[4]+30)%7;
	s[6]=(s[5]+31)%7;
	s[7]=(s[6]+30)%7;
	s[8]=(s[7]+31)%7;
	s[9]=(s[8]+31)%7;
	s[10]=(s[9]+30)%7;
	s[11]=(s[10]+31)%7;
	s[12]=(s[11]+30)%7;
	for(int i=1;i<=12;i++)
	{
		if(s[i]==5)printf("%d\n",i);
	}
	return 0;
}
int main()
{
	int w = 0;
	int i = 0;
	int day = 13;
	int monthDiffer[12] = { 0, 31, 28, 31, 30, 31, 
										30, 31, 31, 30, 31, 30 };
	scanf("%d", &w);

	w = (day - 1 + w) % 7;	// 0???????
	for(i=0; i < 12; i++)
	{
		w = (w + monthDiffer[i]) % 7;
		if(w == 5)
			printf("%d\n", i+1);
	}

	return 0;
}
int main()
{
    int w,b[20],i,sum[20];
	scanf("%d",&w);
	int a[12]={0,31,28,31,30,31,30,31,31,30,31,30};
	for(i=0;i<12;i++)
	{
		if(i==0)
		{sum[i]=0;
		b[i]=(sum[i]+w-1+13)%7;
		}
		else
		{
		sum[i]=a[i]+sum[i-1];
		b[i]=(sum[i]+w-1+13)%7;
		}
		if (b[i]==5)
		{printf("%d\n",i+1);
		}
	}
	return 0;
}
int main()
{
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31},day[13];
    int w,i;
	cin>>w;
	w=(w+12)%7;
	day[1]=w;
	if(w==5)
		cout<<1<<endl;
	for(i=2;i<=12;i++)
	{
        day[i]=(day[i-1]+a[i-1])%7;
		if(day[i]==5)
			cout<<i<<endl;
	}
	return 0;
}
int main () {
    int w;
	scanf ("%d", &w);
	int a[12];
	int i;
	a[0]=13;
	a[1]=31+13;
	a[2]=31+28+13;
    a[3]=31+28+31+13;
	a[4]=31+28+31+30+13;
	a[5]=31+28+31+30+31+13;
	a[6]=31+28+31+30+31+30+13;
	a[7]=31+28+31+30+31+30+31+13;
	a[8]=31+28+31+30+31+30+31+31+13;
	a[9]=31+28+31+30+31+30+31+31+30+13;
	a[10]=31+28+31+30+31+30+31+31+30+31+13;
	a[11]=31+28+31+30+31+30+31+31+30+31+30+13;
		for (i=0; i<12; i++) {
			if ((a[i]-(8-w))%7 == 5) {
		printf ("%d\n", i+1);
			}
		}
    return 0;
}
main()
{                    
 int i,j,k=0,m,n;
 int sum=0;
 scanf("%d",&n);
 int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
 if(n==7)
 for(i=1;i<=12;i++)
 {
 for(j=1;j<=a[i];j++)
 {
                     if(j==13)
                     {
                              if(n==7||n%7==6)
                              printf("%d\n",i);
                              
                     }}
                     sum=sum+a[i];
                     n=sum+13;
                     }
 if(n==6)
 for(i=1;i<=12;i++)
 {
 for(j=1;j<=a[i];j++)
 {
                     if(j==13)
                     {
                              if(n%7==0)
                              printf("%d\n",i);
                              
                     }}
                     sum=sum+a[i];
                     n=sum+13;
                     }
 if(n==5)
 for(i=1;i<=12;i++)
 {
 for(j=1;j<=a[i];j++)
 {
                     if(j==13)
                     {
                              if(n%7==1)
                              printf("%d\n",i);
                              
                     }}
                     sum=sum+a[i];
                     n=sum+13;
                     }
 if(n==4)
 for(i=1;i<=12;i++)
 {
 for(j=1;j<=a[i];j++)
 {
                     if(j==13)
                     {
                              if(n%7==2)
                              printf("%d\n",i);
                              
                     }}
                     sum=sum+a[i];
                     n=sum+13;
                     }
 if(n==3)
 for(i=1;i<=12;i++)
 {
 for(j=1;j<=a[i];j++)
 {
                     if(j==13)
                     {
                              if(n%7==3&&n!=3)
                              printf("%d\n",i);
                              
                     }}
                     sum=sum+a[i];
                     n=sum+13;
                     }
 if(n==2)
 for(i=1;i<=12;i++)
 {
 for(j=1;j<=a[i];j++)
 {
                     if(j==13)
                     {
                              if(n%7==4)
                              printf("%d\n",i);
                              
                     }}
                     sum=sum+a[i];
                     n=sum+13;
                     }
 if(n==1)
 for(i=1;i<=12;i++)
 {
 for(j=1;j<=a[i];j++)
 {
                     if(j==13)
                     {
                              if(n%7==5)
                              printf("%d\n",i);
                              
                     }}
                     sum=sum+a[i];
                     n=sum+13;
                     }
     
}
int day;
int bujili(int m);
int tianshu(int m);
int main(){
	int i;
	scanf("%d",&day);
	for(i=1;i<=12;i++){
		bujili(i);
	}	
	return 0;
}
int bujili(int m){
	int i,s=0;
	int d;
	int a=0;
	for(i=1;i<m;i++){
		s+=tianshu(i);
	}
	s+=12;
	d=(s%7+day)%7;
	//if(d>7){d=d-7;}
	if(d==5){
		printf("%d\n",m);
	}
	return a;
}
int tianshu(int m){
	int t=31;
	if(m==2){t=28;}
	if(m==4||m==6||m==9||m==11){t=t-1;}
	return t;
}
int month(int m);
int main()
{
	int w,m,result=0;
	scanf("%d",&w);
	for(m=0;m<12;m++){
		result+=month(m);
		if((w+result)%7==0){
			printf("%d\n",m+1);
		}
	}
	return 0;
}
int month(int m)
{
	if(m==0){
		return 0;
	}
	else if(m==1||m==3||m==5||m==7||m==8||m==10){
		return 31;
	}
	else if(m==2){
		return 28;
	}
	else if(m==4||m==6||m==9||m==11){
		return 30;
	}
}
int main()
{
    int i,j,a[13]={0},w;
    a[1]=13;a[2]=31+a[1];a[3]=28+a[2];a[4]=31+a[3];a[5]=30+a[4];
    a[6]=31+a[5];a[7]=30+a[6];a[8]=31+a[7];a[9]=31+a[8];a[10]=30+a[9];
    a[11]=31+a[10];a[12]=30+a[11];
    scanf("%d",&w);
    for(i=1;i<13;i++)
    {
       if((a[i]+w)%7==6)
       {printf("%d\n",i);}
    }

    
}
int main()
{
	int day[12]={31,28,31,30,31,30,
		31,31,30,31,30,31};
	int mon13[12];
	int i=0;
	scanf("%d",&mon13[0]);
	mon13[0]=mon13[0]+12;
	for(i=1;i<12;i++)	mon13[i]=mon13[i-1]+day[i-1];
	for(i=0;i<12;i++)
	{
		if(mon13[i]%7==5)printf("%d\n",i+1);
	}
	return 0;
}
int main(){
int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int w,i,j,sum=13,day;
scanf("%d",&w);
for(j=1;j<=12;j++){
	for(i=0;i<=j-1;i++){
    sum=sum+a[i];
	}
	day=sum%7;
    day=(w+day)%7;
	if(day==6){
		printf("%d\n",j);
	}
	sum=13;
	}
return 0;
}
int main()
{
	int total[15],w,i,j,m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};  //m??????? total???????????
	cin>>w;
	for(i=1;i<=12;i++)
	{
		total[i]=0;      //?????
	}
	for(i=2;i<=12;i++)
	{
		for(j=1;j<i;j++)
		{
			total[i]=total[i]+m[j];  //??total
		}
	}
	/*for(i=1;i<=12;i++)
	{
		cout<<total[i]<<" ";    //????total??????
	}
	return 0;
}
	*/
	for(i=1;i<=12;i++)
	{
		if((total[i]+13-1+(w-5))%7==0)  //????????
		{
			cout<<i<<endl;
		}
	}
	return 0;
}
int main(int argc, char* argv[])
{
	int n;
	scanf("%d",&n);
	if((12%7+n-7)==5||(12%7+n)==5) printf("1\n");
	if((43%7+n-7)==5||(43%7+n)==5) printf("2\n");
	if((71%7+n-7)==5||(71%7+n)==5) printf("3\n");
	if((102%7+n-7)==5||(102%7+n)==5) printf("4\n");
	if((132%7+n-7)==5||(132%7+n)==5) printf("5\n");
	if((163%7+n-7)==5||(163%7+n)==5) printf("6\n");
	if((193%7+n-7)==5||(193%7+n)==5) printf("7\n");
	if((224%7+n-7)==5||(224%7+n)==5) printf("8\n");
	if((255%7+n-7)==5||(255%7+n)==5) printf("9\n");
	if((285%7+n-7)==5||(285%7+n)==5) printf("10\n");
	if((316%7+n-7)==5||(316%7+n)==5) printf("11\n");
	if((346%7+n-7)==5||(346%7+n)==5) printf("12\n");
	return 0;
}
main()
{
int a,t,day,q;
int i[12]={31,28,31,30,31,30,31,31,30,31,30,31};
t=0;
q=1;
scanf("%d",&a);
for(day=1;day<=365;day++)
{
                  if(a>7)
                  {
                         a=a-7;
                  }
                  if(q>i[t])
                  {
                             q=q-i[t];
                             t=t+1;
                  }
                  if(q==13)
                  {   if(a==5)
                      printf("%d\n",t+1);
                  }
                  a=a+1;
                  q=q+1;
}

}
int main()
{
	int w;
	scanf("%d",&w);
	if((((13%7)-1+w)==5)||(((13%7)-1+w)==12))
		printf("1\n");
	if((((44%7)-1+w)==5)||(((44%7)-1+w)==12))
		printf("2\n");
	if((((72%7)-1+w)==5)||(((72%7)-1+w)==12))
		printf("3\n");
	if((((103%7)-1+w)==5)||(((103%7)-1+w)==12))
		printf("4\n");
	if((((133%7)-1+w)==5)||(((133%7)-1+w)==12))
		printf("5\n");
	if((((164%7)-1+w)==5)||(((164%7)-1+w)==12))
		printf("6\n");
	if((((194%7)-1+w)==5)||(((194%7)-1+w)==12))
		printf("7\n");
	if((((225%7)-1+w)==5)||(((225%7)-1+w)==12))
		printf("8\n");
	if((((256%7)-1+w)==5)||(((1256%7)-1+w)==12))
		printf("9\n");
	if((((286%7)-1+w)==5)||(((286%7)-1+w)==12))
		printf("10\n");
	if((((317%7)-1+w)==5)||(((317%7)-1+w)==12))
		printf("11\n");
	if((((347%7)-1+w)==5)||(((347%7)-1+w)==12))
		printf("12\n");
	return 0;
}


// 13 44 74 103 133 164 194 225 256 286 317 347
int main(){
	int n,m;
	scanf("%d",&n);
	m=13-n;
	if((13-m)%7==0)
		printf("1\n");
	if((44-m)%7==0)
		printf("2\n");
	if((72-m)%7==0)
		printf("3\n");
	 if((103-m)%7==0)
		printf("4\n");
	 if((133-m)%7==0)
		printf("5\n");
	 if((164-m)%7==0)
		printf("6\n");
	 if((194-m)%7==0)
		printf("7\n");
	 if((225-m)%7==0)
		printf("8\n");
	 if((256-m)%7==0)
		printf("9\n");
	 if((286-m)%7==0)
		printf("10\n");
	if((316-m)%7==0)
		printf("11\n");
	if((347-m)%7==0)
		printf("12\n");
	return 0;
}
int main()
{
int n;
scanf("%d",&n);
int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int i,j;
int k;
for(i=1;i<=12;i++)
 {
    int days=0;
	for(j=i-1;j>=0;j--)
   {
	days=days+month[j];
   }
	days+=13;
   k=n-1+days%7;
   if(k==0)
   	{
   	  k=7;
    }
    else if(k>7)
    {
    	k=k-7;
    }
     if(k==5)
	{
       printf("%d\n",i);
    }
   }
return 0;
}
int main()
{
	int i,k,t,m,n,h,g;
	int a[12];
	scanf("%d",&n);
	m=0;
	for(i=0;i<12;i++)
	{
       if(i==0)
	   {h=12;}
	   if(i==1||i==3||i==5||i==7||i==8||i==10)
	   {h=31;}
	   if(i==2)
	   {h=28;}
	   if(i==4||i==6||i==9||i==11)
	   {h=30;}
	   m=m+h;
	   a[i]=m;
	}
	k=0;
	k=5-n;
	if(k<0)
	{
		k=7+k;
	}
	for(i=0;i<12;i++)
	{
		t=i+1;
       g=a[i]%7;
	   if(g==k)
	   {
		   printf("%d\n",t);
	   }
	}
	return 0;
}
void main()
{
	int a[12],i,j=0,month,day,d,w;
	scanf("%d",&w);
	for(month=1;month<=12;month++)
	{
		if(month==1||month==3||month==5||month==7||month==8||month==10||month==12) day=31;
		else if(month==4||month==6||month==9||month==11) day=30;
		else if(month==2) day=28;
		for(d=1;d<=day;d++)
		{
			if(d==13)
			{
				if(w==5)
				{
					a[j]=month;
					j++;
				}
				w++;
				if(w==8)
				{
					w=1;
				}
			}
			else if(d!=13)
			{
				w++;
				if(w==8)
				{
					w=1;
				}
			}
		}
	}
	for(i=0;i<j;i++)
	{
		printf("%d\n",a[i]);
	}
}
int main(){
	int w,i,j,s;
	scanf("%d",&w);
	for(i=1;i<=12;i++){
		switch(i){
		case 1:s=13;break;
	    case 2:s=s+31;break;
		case 3:s=s+28;break;
		case 4:s=s+31;break;
	    case 5:s=s+30;break;
		case 6:s=s+31;break;
	    case 7:s=s+30;break;
		case 8:s=s+31;break;
		case 9:s=s+31;break;
		case 10:s=s+30;break;
		case 11:s=s+31;break;
		case 12:s=s+30;break;
		}
		if ((s-1+w)%7==5)printf("%d\n",i);
	}
	return 0;
}
int main()
{
	int w;
	int t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12;
	int d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12;
	scanf("%d",&w);
	t1=6+w-1;
	t2=2+w-1;
	t3=2+w-1;
	t4=5+w-1;
	t5=w-1;
	t6=3+w-1;
	t7=5+w-1;
	t8=1+w-1;
	t9=4+w-1;
	t10=6+w-1;
	t11=2+w-1;
	t12=4+w-1;
	if(t1>7)
		d1=t1%7;
	else
		d1=t1;
	if(d1==5)
		printf("1\n");
	if(t2>7)
		d2=t2%7;
	else
		d2=t2;
	if(d2==5)
		printf("2\n");
	if(t3>7)
		d3=t3%7;
	else
		d3=t3;
	if(d3==5)
		printf("3\n");
	if(t4>7)
		d4=t4%7;
	else
		d4=t4;
	if(d4==5)
		printf("4\n");
	if(t5>7)
		d5=t5%7;
	else
		d5=t5;
	if(d5==5)
		printf("5\n");
	if(t6>7)
		d6=t6%7;
	else
		d6=t6;
	if(d6==5)
		printf("6\n");
	if(t7>7)
		d7=t7%7;
	else
		d7=t7;
	if(d7==5)
		printf("7\n");
	if(t8>7)
		d8=t8%7;
	else
		d8=t8;
	if(d8==5)
		printf("8\n");
	if(t9>7)
		d9=t9%7;
	else
		d9=t9;
	if(d9==5)
		printf("9\n");
	if(t10>7)
		d10=t10%7;
	else
		d10=t10;
	if(d10==5)
		printf("10\n");
	if(t11>7)
		d11=t11%7;
	else
		d11=t11;
	if(d11==5)
		printf("11\n");
	if(t12>7)
		d12=t12%7;
	else
		d12=t12;
	if(d12==5)
		printf("12\n");
	return 0;
}
int count(int month)
{
	int c[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int i,answer=0;
	for(i=0;i<month;i++)
	answer+=c[i];
	answer+=13;
	return(answer);
}
void main()
{
	int t,w,a[13],i,b[13];
	scanf("%d",&w);
    for(i=1;i<=12;i++)
	{
		a[i]=count(i);
		a[i]-=1;
	}
    t=7-w;
	for(i=1;i<=12;i++)
	{
		b[i]=(a[i]-t)%7;
	}
	for(i=1;i<=12;i++)
	{
		if(b[i]==5)
			printf("%d\n",i);
	}
}
int main()
{
   int w,month,xqj;
   scanf("%d",&w);

   for(month=1;month<=12;month++){
       int dijit=13;
       for(int i=1;i<month;i++){
           if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
                dijit+=31;
           }
           else if(i==2){
                dijit+=28;
           }else{
                dijit+=30;
           }
      }

      xqj=(dijit+w-8)%7;
      if(xqj==5){
          printf("%d\n",month);
      }
   }

   return 0;
}
int main (){
	int w,i,sum=0,n;
	scanf("%d",&w);
	if((13+w-1)%7==5){
		printf("1\n");
	}
	for (n=2;n<=12;n++){
		sum=0;
	for (i=1;i<n;i++){
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			sum+=31;
		}
	else	if(i==2){
			sum+=28;
		}
		else{
			sum+=30;
		}
	}
	sum+=13;
	if((sum+w-1)%7==5){
		printf("%d\n",n);
	}
	}
	return 0;
}