semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int f(int x);
int main(){
	int w,i;
    scanf("%d",&w);
    for(i=1;i<=12;i++){

        if(f(i)%7+w-1==5||f(i)%7+w-1==12){
		printf("%d\n",i);
		}
	}
	return 0;
}
int f(int x){
	int result;
	if(x==1){
		result=13;
	}
    if(x==2){
	result=44;
	}
	if(x==3){
	result=72;
	}
	if(x==4){
	result=103;
	}
	if(x==5){
		result=133;
	}
	if(x==6){
		result=164;
	}
	if(x==7){
		result=194;
	}
	if(x==8){
		result=225;
	}
	if(x==9){
		result=256;
	}
	if(x==10){
		result=286;
	}

	if(x==11){
		result=317;
	}
	if(x==12){
		result=347;
	}
	return result ;
}
int main()
{
	int day,month;
	scanf("%d",&day);day+=12;
	for(month=1;month<=12;month++)
	{
		switch(month-1)
		{
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:
	    case 12:day+=31;break;
		case 2: day+=28;break;
	    case 0:break;
	    default: day+=30;break;
		}
		if(day%7==5) printf("%d\n",month);
	}
	return 0;
}
int main()
{
	int a,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12;

	scanf("%d",&a);

	y1=(a+12)%7;
	y2=(a+31+12)%7;
	y3=(a+31+28+12)%7;
	y4=(a+31+28+31+12)%7;
	y5=(a+31+28+31+30+12)%7;
	y6=(a+31+28+31+30+31+12)%7;
	y7=(a+31+28+31+30+31+30+12)%7;
	y8=(a+31+28+31+30+31+30+31+12)%7;
	y9=(a+31+28+31+30+31+30+31+31+12)%7;
	y10=(a+31+28+31+30+31+30+31+31+30+12)%7;
	y11=(a+31+28+31+30+31+30+31+31+30+31+12)%7;
	y12=(a+31+28+31+30+31+30+31+31+30+31+30+12)%7;
	
	if(y1==5)
	{
		printf("1\n");
	}
	if(y2==5)
	{
		printf("2\n");
	}
	if(y3==5)
	{
		printf("3\n");
	}if(y4==5)
	{
		printf("4\n");
	}
	if(y5==5)
	{
		printf("5\n");
	}
	if(y6==5)
	{
		printf("6\n");
	}
	if(y7==5)
	{
		printf("7\n");
	}
	if(y8==5)
	{
		printf("8\n");
	}
	if(y9==5)
	{
		printf("9\n");
	}
	if(y10==5)
	{
		printf("10\n");
	}
	if(y11==5)
	{
		printf("11\n");
	}
	if(y12==5)
	{
		printf("12\n");
	}
	return 0;
}
int main()
{
	int w,m,x,sd=13,p,d,i;
	scanf("%d",&w);
	for(m=1;m<=12;m++)
	{
		for(i=1;i<=m;i++)
		{
			switch(i)
			{
				case 1:
				p=0;
				break;	case 2:
				p=31;
				break;	case 3:
				p=28;
				break;	case 4:
				p=31;
				break;	case 5:
				p=30;
				break;	case 6:
				p=31;
				break;	case 7:
				p=30;
				break;	case 8:
				p=31;
				break;	case 9:
				p=31;
				break;	case 10:
				p=30;
				break;	case 11:
				p=31;
				break;	case 12:
				p=30;
			}
			
		}sd=sd+p;
		d=sd%7;
		x=(d+w-1)%7;
		if(x==5)
			printf("%d\n",m);
	}
	return 0;
}
int main()
{
    int w,i,a[12];
    scanf("%d",&w);
    if(w<3)
       a[1]=w+5;
    else
       a[1]=w-2;
    a[2]=a[1]+31%7;
    if(a[2]>7)
       a[2]-=7;
    a[3]=a[2];
    a[4]=a[3]+31%7;
    if(a[4]>7)
       a[4]-=7;
    a[5]=a[4]+30%7;
    if(a[5]>7)
       a[5]-=7;
    a[6]=a[5]+31%7;
    if(a[6]>7)
       a[6]-=7;
    a[7]=a[6]+30%7;
    if(a[7]>7)
       a[7]-=7;
    a[8]=a[7]+31%7;
    if(a[8]>7)
       a[8]-=7;
    a[9]=a[8]+31%7;
    if(a[9]>7)
       a[9]-=7;
    a[10]=a[9]+30%7;
    if(a[10]>7)
       a[10]-=7;
    a[11]=a[10]+31%7;
    if(a[11]>7)
       a[11]-=7;
    a[12]=a[11]+30%7;
    if(a[12]>7)
       a[12]-=7;
    for(i=1;i<=12;i++)
       if(a[i]==5)
          printf("%d\n",i);
    return 0;
}
int main ()
{
	int w,i,a;
	scanf("%d",&w);
	if(w==7)
	{
		printf("1\n");
		printf("10\n");
	}
	if(w==6)
	{
		printf("5\n");
	}
	if(w==2)
	{
	    printf("9\n");
		printf("12\n");
	}
	if(w==5)
	{
		printf("8\n");
	}
	if(w==4)
	{
		printf("2\n");
		printf("3\n");
		printf("11\n");
	}
	if(w==1)
	{
		printf("4\n");
		printf("7\n");
	}
	if(w==3)
	{
		printf("6\n");
	}

	return 0;
}
//********************************
//*????????            **
//*?????? 1200012839    **
//*???2012.11.12          **
//********************************

int main()                           //???
{
    int jun1, month[13] = {0,0,31,59,90,120,151,181,212,243,273,304,334};
    cin >> jun1;
    for (int i = 1; i <= 12; i++)
    {
        if (((month[i] + 12) % 7 + jun1) % 7 == 5)
            cout << i << endl;
    }
    
    return 0;
}
int main()
{
	int a[13]={0,6,2,2,5,0,3,5,1,4,6,2,4};
	int i,w;
	int b[8]={0,5,4,3,2,1,0,6};
	cin>>w;
	for(i=1;i<=12;i++)
	{
		if(a[i]==b[w])
			cout<<i<<endl;
	}
	return 0;
}
int main()
{
	int n,i,a[12]={31,28,31,30,31,30,31,31,30,31,30,31},b[12];
	cin>>n;
	b[0]=12+n;
	if(b[0]%7==5)
	{
		cout<<"1"<<'\n';
	}
	for(i=1;i<=11;i++)
	{
		b[i]=b[i-1]+a[i-1];
		if(b[i]%7==5)
		{
			cout<<i+1<<'\n';
		}
	}
	return 0;
}
//********************************
//*???1.cpp   **
//*?????? 1200012768 **
//*???2012.11.10  **
//*????????  **
//********************************
int main()
{
	int w, days = 12, i = 1;
	cin >> w;
	do
	{
		int rem = days % 7;
		if ((rem + w == 5) || (rem + w == 12))
			cout << i << endl;
		switch (i)
		{
			case 1:
				days += 31; break;
			case 2:
				days += 28; break;
			case 3:
				days += 31; break;
			case 4:
				days += 30; break;
			case 5:
				days += 31; break;
			case 6:
				days += 30; break;
			case 7:
				days += 31; break;
			case 8:
				days += 31; break;
			case 9:
				days += 30; break;
			case 10:
				days += 31; break;
			case 11:
				days += 30; break;
			default :
				break;
		}
		i++;
	} while (i < 13);
	return 0;
}
int main()
{
	int n,i,a,y,x;
	int thirteen[12]={13,44,72,103,133,164,194,225,256,286,317,347};
	cin>>n;
	for (i=0;i<12;i++){
		y = thirteen[i]%7;
		a = 8-y;
		x = n-a;
		if (x==5||x==-2){
			cout<<i+1<<endl;
		}
	}
	return 0;
}
struct mounth
{
	int week;
	int days;
}M[12]={{1,31},{2,28},{3,31},{4,30},{5,31},{6,30},{7,31},{8,31},{9,30},{10,31},{11,30},{12,31}};
void main()
{
	int w,i,total=12;
	scanf("%d",&w); 
	if((w+total)%7==5) printf("1\n");
	for(i=0;i<11;i++)
	{
		total=total+M[i].days;
		if((w+total)%7==5) printf("%d\n",i+2);
	}
}
//******************************
//*??? : ?????         *
//*??   : ???             *
//*??   : 2011?11?         *
//******************************
int main ()
{
	int w, i, j, t[13] = {0}; 
	int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    cin >> w;
	for (i = 1; i <= 12; i++)
	{
		for (j = 1; j <= i - 1; j++)
		{
			t[i] = t[i] + a[j];
		}
		t[i] = t[i] + 12 + w;
	}
    for (i = 1; i <= 12; i++)
	{
		if (t[i] % 7 == 5)
		{
		cout << i << endl;
		}
	}
	return 0;
}
//***************************************************************************************
//??:????????????????                                                 *
//?????10.20                                                                       *
//????wayne                                                                         *
//***************************************************************************************
int main()
{
	int n,i,a[13];
	cin>>n;
	a[1]=12+n,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;    //????????13??1.1???         
	for (i=1;i<=12;i++)                             //????????????
		if (a[i]%7==5)  cout<<i<<endl;              //???????   
	return 0;
}
int main()
{
    int w,n,i,sum;
    int a[13];
    a[1]=a[3]=a[5]=a[7]=a[8]=a[10]=a[12]=31;
    a[4]=a[6]=a[9]=a[11]=30;
    a[2]=28;
    scanf("%d",&w);
    sum=0;
    if((12+w)%7==5)
       printf("1\n");
    for(i=1;i<12;i++)
    {
       sum+=a[i];
       if((sum+12+w)%7==5)
          printf("%d\n",i+1);
    }
}
int main()
{
   int n,week=0;
   scanf("%d",&n);
   int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
   int i,day[13],sum=0;
   for(i=1;i<=12;i++)
   {
	   day[i]=sum+13;
	   sum+=d[i];
	   week=(day[i]%7+n-1)%7;

	   if(week==5) printf("%d\n",i);
   }
   return 0;
}
int main(){
	int n,b,i,k;
	k=13;
	scanf("%d",&n);
	if(n==1){
		b=5;
	}
if(n==2){
		b=4;
	}
if(n==3){
		b=3;
	}
if(n==4){
		b=2;
	}
if(n==5){
		b=1;
	}
if(n==6){
		b=0;
	}
if(n==7){
		b=6;
	}
	for(i=1;i<=12;i++){
		if(k%7==b){
			printf("%d\n",i);
		}
		if(i==1||i==3||i==5||i==7||i==8||i==10){
			k+=31;
	   }
		else if(i==4||i==6||i==9||i==11){
			k+=30;
		}
		else{
			k+=28;
		}
	}

	return 0;
}
int main(){
	int w;
	scanf("%d",&w);
	int i,d=12;
	for(i=1;i<=12;i++){
		if(i==3){
			d+=28;
		}
		else if(i==5||i==7||i==10||i==12){
			d+=30;
		}
		else if(i==2||i==4||i==6||i==8||i==9||i==11){
			d+=31;
		}
		if((d%7+w)%7==5){
			printf("%d\n",i);
		}
	}
return 0;
}
int main()
{
	int i,d[100],y,a,w;
		int m[100]={31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d",&w);
	for(i=1;i<=12;i++){
		if (i==1)
			d[1]=12;
		if (i>=2){
			d[i]=d[i-1]+m[i-2];}
		}
		for(i=1;i<=12;i++){
			y=w-5;
			a=(d[i]+y)%7;
			if(a==0)
				printf("%d\n",i);
		}
		return 0;
	}
int main (){
	int w,n=13,m,i;
	scanf("%d",&w);
    int	d[12]={0,31,28,31,30,31,30,31,31,30,31,30};
	for (i=1;i<=12;i++){
		m=0;
		n+=d[i-1];
		m=n%7+w-1;
		if (m>7)
			m=m%7;
		if (m==5)
			printf("%d\n",i);
	}
	return 0;
}
int main()
{
    int a[12]={31,28,31,30,31,30,31,31,30,31,30,31},b[12]={0};
	int w,k;
	scanf("%d",&w);
	w+=12;
	for(int j=0;j<12;j++)
	{   
		if(w%7==5)
		{
			printf("%d\n",j+1);
		}
		w+=a[j];
	}
	    
	return 0;
}
int main()
{
	int w,day=0,a[12];
	cin>>w;
	a[0]=a[2]=a[4]=a[6]=a[7]=a[9]=a[11]=31;        //:???????????
	a[3]=a[5]=a[8]=a[10]=30;
	a[1]=28;
	if (w==7)
	{
		cout<<"1"<<endl;
	    cout<<"10"<<endl;
	}
	else
	{
		for (int i=0;i<11;i++)             //:????1??1?1?????????1???????13????
		{  
			day=day+a[i];
		if ((day-7+w)%7==0)
			cout<<i+2<<endl; 
		}
	}
		return 0;
}
int main()
{
	int w,i;
	scanf("%d",&w);
	int a[11]={31,28,31,30,31,30,31,31,30,31,30};
	int b[12];
	b[0]=w+12;
	if(b[0]%7==5)printf("1\n");
	for(i=1;i<12;i++)
	{
		b[i]=b[i-1]+a[i-1];
		if(b[i]%7==5)printf("%d\n",i+1);
	}
}
int main()
{ int t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,w;
  scanf("%d",&w);
  if ((12%7+w)%7==5) printf("1\n");
  
  t2=(31%7+w)%7;//printf("%d",t2);
  if ((12%7+t2)%7==5) printf ("2\n");
  
  t3=(28%7+t2)%7;
  if ((12%7+t3)%7==5) printf ("3\n");
  
  t4=(31%7+t3)%7;
  if ((12%7+t4)%7==5) printf ("4\n");
  
  t5=(30%7+t4)%7;
  if ((12%7+t5)%7==5) printf ("5\n");
  
  t6=(31%7+t5)%7;
  if ((12%7+t6)%7==5) printf ("6\n");
  
  t7=(30%7+t6)%7;
  if ((12%7+t7)%7==5) printf ("7\n");
  
  t8=(31%7+t7)%7;
  if ((12%7+t8)%7==5) printf ("8\n");
  
  t9=(31%7+t8)%7;
  if ((12%7+t9)%7==5) printf ("9\n");
  
  t10=(30%7+t9)%7;
  if ((12%7+t10)%7==5) printf ("10\n");
 
  t11=(31%7+t10)%7;
  if ((12%7+t11)%7==5) printf ("11\n");
  
  t12=(30%7+t11)%7;
  if ((12%7+t12)%7==5) printf ("12\n");
  
  
  return 0;

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








	return 0;
}
void main()
{
    int w,a[12]={12,31,28,31,30,31,30,31,31,30,31,30},b,c,i=0;
    scanf("%d",&w); 
    while(i<=11)
    {
       b=a[i]%7+w;
       c=b%7;  
    if  (c==5)
    {printf("%d\n",i+1);i=i+1;a[i]=a[i]+a[i-1];}
    else {i=i+1;a[i]=a[i]+a[i-1];}         
    }
    
}
int Dijitian(int month,int day)
{
	int days=0,i;
	for(i=1;i<month;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			days+=31;
		}
		else
		{
			if(i==2)
			{
				days+=28;
			}
			else
			{
				days+=30;
			}
		}
	}
	days+=day;
	return days;
}
int main()
{
	int w,i;
	scanf("%d",&w);
	for(i=1;i<13;i++)
	{
		if((Dijitian(i,13)-1)%7+w==5||(Dijitian(i,13)-1)%7+w==12)
		{
			printf("%d\n",i);
		}
	}
	return 0;
}
int main()
{
	int w,s,d,i,j,a[12];
	scanf("%d",&w);
	s=0;
	j=0;
	for(i=0;i<12;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10)
		{
			s+=31;
		}
		else if(i==2)
		{
			s+=28;
		}
		else if(i==4||i==6||i==9||i==11)
		{
			s+=30;
		}
		d=s+13;
		d=d%7;
		if(((d+w-8==5)&&(d+w>8))||((d+w-1==5)&&(d+w<=8)))
		{
			a[j++]=i+1;
		}
	}
	for(i=0;i<j;i++)
	{
		printf("%d",a[i]);
		if(i!=j-1)
		{
			printf("\n");
		}
	}
	return 0;
}
int main()
{
	int i,w,a[11]={31,28,31,30,31,30,31,31,30,31,30};
    int t=0;
    scanf("%d",&w);
    if(w==7)
	{
		printf("%d\n%d\n",1,10);
	}
    else
	{
		for(i=0;i<11;i++)
		{
			t+=a[i];
	        if((t%7+w)%7==0)
				printf("%d\n",i+2);
		}
	}
	return 0;
}
int main()
{int n;
scanf("%d",&n);
if(n==7){printf("1\n10");}
if(n==1){printf("4\n7");}
if(n==2){printf("9\n12");}
if(n==3){printf("6");}
if(n==4){printf("2\n3\n11");}
if(n==5){printf("8");}
if(n==6){printf("5");}
if(n!=7&&n!=1&&n!=2&&n!=3&&n!=4&&n!=5&&n!=6){printf("0");}

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

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

	return 0;
}
int main(int argc, char* argv[])
{
	int w,i,j;
	int total[13];
	scanf("%d",&w);
	for(j=1;j<=12;j++){
		total[j]=12;
		for(i=1;i<j;i++){
			if(i==1||i==3||i==5||i==7||i==8||i==10)
				total[j]+=31;
			if(i==4||i==6||i==9||i==11)
				total[j]+=30;
			if(i==2)
				total[j]+=28;
		}
		if((w<=5&&total[j]%7==5-w)||(w>5&&total[j]%7==12-w))
			printf("%d\n",j);
	}
	return 0;
}
int main()
{
	int w,i,x=12,k[12][1]={0},j;
	cin>>w;
	int m[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	for(i=0;i<12;i++)
	{
		x=x+m[i];
		j=x%7;
		if(w+j==5||w+j-7==5)
			k[i][0]=1;
	}
	for(i=0;i<12;i++)
	{
		if(k[i][0]!=0)
			cout<<i+1<<endl;
	}
	return 0;
}
int f(int w,int m,int d)
{
	int i,x=d-1;
	for(i=1;i<m;i++)
	{
		if(i==2)x=x+28;
		else if(i<8)x=x+30+i%2;
		else x=x+31-i%2;
	}
	x=(w+x%7)%7;
	return(x);
}
void main()
{
	int w,i;
	scanf("%d",&w);
	for(i=1;i<=12;i++)
	{
		if(f(w,i,13)==5)printf("%d\n",i);
	}
}
int main()
{
    int x,y[12],i;
    scanf("%d",&x);
    y[0]=x+12%7;
    y[1]=x+43%7;
    y[2]=x+71%7;
    y[3]=x+102%7;
    y[4]=x+132%7;
    y[5]=x+163%7;
    y[6]=x+193%7;
    y[7]=x+224%7;
    y[8]=x+255%7;
    y[9]=x+285%7;
    y[10]=x+316%7;
    y[11]=x+346%7;
    for (i=0;i<=11;i++){
        if (y[i]>7) y[i]=y[i]%7;
                        }
    for (i=0;i<=11;i++){
        if (y[i]==5) printf("%d\n",i+1);
        }

    return 0;
}
void main()
{
	int date,l=0,a[12],mouth[13]={0,31,28,31,30,31,30,31,31,30,31,30,31},i,j,k,b[100],*p;
	scanf("%d",&date);
	p=a;
	if(6-date>0)
		b[0]=6-date;
	else b[0]=13-date;
	i=0;k=0;
	while(b[i]<=365)
	{
		b[i+1]=b[i]+7;
		i++;k++;}
	for(i=0;i<=k;i++)
	    for(j=0;j<13;j++)
		{
			if(b[i]-mouth[j]==13)
			{
				b[i]=b[i]-mouth[j];
				*p++=j+1;
			     l++;
			}
			else b[i]=b[i]-mouth[j];
		}
	for(i=0;i<l-1;i++)
		printf("%d\n",a[i]);
	printf("%d\n",a[l-1]);
}
//
//  main.cpp
//  ?????
//
//  Created by ? ?? on 12-11-10.
//  Copyright (c) 2012? ? ??. All rights reserved.
//



int main()
{
    int w;
    int i, j;
    int sum = 0, d;
    cin >> w;
    int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    
    for (i = 0; i < 12; i++)
    {
        sum =0;
        if (i == 0)
        {
            d = 13 - (9 - w);
        }
        else
        {
            
            for (j = 0; j < i; j++)
            {
                sum = sum + a[j];
            }
            d = sum + 4 + w;
        }
        if (d % 7 == 4)
        {
            cout << i + 1 << endl;
        }
    }
    
    
    return 0;
}
int main()
{   
 int w;
 scanf("%d",&w);
 int i,a,b;
 a=12; 
b=a%7+w;
b=b%7;
 if(b==5)
 {
 printf("1\n");
 }

 for(i=1;i<12;i++)
 {
	if(i==1||i==3||i==5||i==7||i==8||i==10)
	{
		a=31;
	    b=a%7+b; 
	b=b%7;

		if(b==5)
		printf("%d\n",i+1);
    
	}

	else if(i==2)
	{
	a=28;
	    b=a%7+b;
		b=b%7;

       if(b==5)
		printf("%d\n",i+1);
	}
		else
	{
	a=30;
	    b=a%7+b;
		b=b%7;
       if(b==5)
		printf("%d\n",i+1);
	}


	}

    
    

	return 0;
}
int main()
{
	int  w,i;
	int m=0;
	int t=0;
	int a[15]={0,31,59,90,120,151,181,212,243,273,304,334};
	scanf("%d",&w);
	if(w>=1&&w<=5)
		m=6-w;
	else if(w>=6&&w<=7)
		m=13-w;
    for(i=0;i<=11;i++)
		if((a[i]+13-m)%7==0)
		{
			t=i+1;
			printf("%d\n",t);
		}
		return 0;
}
int check(int a)
{
    if(a>7)
    return a-7;
    else
    return a;

}
int main()
{
    int n;
    scanf("%d",&n);
    int m[12];
    int i;
    m[0]=12%7+n;
    m[0]=check(m[0]);
    //printf("%d",m[0]);
    for(i=1;i<12;i++)
    {
        switch(i)
        {
        case 1:case 3:case 5:case 7:case 8:case 10:
        m[i]=31%7+m[i-1];
        break;
        case 2:
        m[i]=28%7+m[i-1];
        break;
        case 4:case 6:case 9:case 11:
        m[i]=30%7+m[i-1];
        }
        m[i]=check(m[i]);
    }
    for(i=1;i<=12;i++)
   if(m[i-1]==5)
    printf("%d\n",i);
}
int main()
{
	int w,w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12;
	int m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12;
	scanf("%d",&w);
	w1=w+5;
	if(w1>7){
		w1=w1-7;
	}
	if(w1==5){
		printf("1\n");
	}
	m2=w+3;
	if(m2>7){
		m2=m2-7;
	}
	w2=m2+5;
	if(w2>7){
		w2=w2-7;
	}
	if(w2==5){
		printf("2\n");
	}
	m3=m2;
	w3=m3+5;
	if(w3>7){
		w3=w3-7;
	}
	if(w3==5){
		printf("3\n");
	}
	m4=m3+3;
	if(m4>7){
		m4=m4-7;
	}
	w4=m4+5;
	if(w4>7){
		w4=w4-7;
	}
	if(w4==5){
		printf("4\n");
	}
	m5=m4+2;
	if(m5>7){
		m5=m5-7;
	}
	w5=m5+5;
	if(w5>7){
		w5=w5-7;
	}
	if(w5==5){
		printf("5\n");
	}
	m6=m5+3;
	if(m6>7){
		m6=m6-7;
	}
	w6=m6+5;
	if(w6>7){
		w6=w6-7;
	}
	if(w6==5){
		printf("6\n");
	}
	m7=m6+2;
	if(m7>7){
		m7=m7-7;
	}
	w7=m7+5;
	if(w7>7){
		w7=w7-7;
	}
	if(w7==5){
		printf("7\n");
	}
	m8=m7+3;
	if(m8>7){
		m8=m8-7;
	}
	w8=m8+5;
	if(w8>7){
		w8=w8-7;
	}
	if(w8==5){
		printf("8\n");
	}
	m9=m8+3;
	if(m9>7){
		m9=m9-7;
	}

	w9=m9+5;
	if(w9>7){
		w9=w9-7;
	}
	if(w9==5){
		printf("9\n");
	}

	m10=m9+2;
	if(m10>7){
		m10=m10-7;
	}

	w10=m10+5;
	if(w10>7){
		w10=w10-7;
	}
	if(w10==5){
		printf("10\n");
	}

	m11=m10+3;
	if(m11>7){
		m11=m11-7;
	}

	w11=m11+5;
	if(w11>7){
		w11=w11-7;
	}
	if(w11==5){
		printf("11\n");
	}

	m12=m11+2;
	if(m12>7){
		m12=m12-7;
	}
	w12=m12+5;
	if(w12>7){
		w12=w12-7;
	}
	if(w12==5){
		printf("12\n");
	}
	return 0;
}
int main()
{
	int d[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int n,sum,i,j;
	cin>>n;
	for(i=1;i<=12;i++){
		sum=0;
		for(j=0;j<i-1;j++){
			sum+=d[j];
		}
		if((sum+13+n-1)%7==5) cout<<i<<endl;
	}
	return 0;
}
int main(){
	int w,i,a[365],c=0;
	scanf("%d",&w);
	a[0]=w;
	for(i=0;i<364;i++){
		if(a[i]==7)
			a[i]=0;
		a[i+1]=a[i]+1;
	}
	for(i=0;i<365;i++){
		if(a[i]==5){
			if(i==12){
				printf("1\n");
				c++;
			}
			if(i==43){
				printf("2\n");
				c++;
			}
			if(i==71){
				printf("3\n");
				c++;
			}
			if(i==102){
				printf("4\n");
				c++;}
			if(i==132){
				printf("5\n");
				c++;}
			if(i==163){
				printf("6\n");
				c++;}
			if(i==193){
				printf("7\n");
				c++;}
			if(i==224){
				printf("8\n");
				c++;}
			if(i==255){
				printf("9\n");
				c++;}
			if(i==285){
				printf("10\n");
				c++;}
			if(i==316){
				printf("11\n");
				c++;}
			if(i==346){
				printf("12\n");
				c++;}
		}
	}
	return 0;
}
int main(){
	int w,m,d,y;
	scanf("%d",&w);
	for(m=1;m<2;m++){
		d=13;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	for(m=2;m<3;m++){
		d=44;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	for(m=3;m<4;m++){
		d=72;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	for(m=4;m<5;m++){
		d=103;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	for(m=5;m<6;m++){
		d=133;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	for(m=6;m<7;m++){
		d=164;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	for(m=7;m<8;m++){
		d=194;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	for(m=8;m<9;m++){
		d=225;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	for(m=9;m<10;m++){
		d=256;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	for(m=10;m<11;m++){
		d=286;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	for(m=11;m<12;m++){
		d=317;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	for(m=12;m<13;m++){
		d=347;
		y=(d+w-1)%7;
		if(y==5){
			printf("%d\n",m);
		}
	}
	return 0;
}
int main()
{
    int w,t,i;
    int a[13];
    scanf("%d",&w);
    a[1]=31;
    a[2]=28;
    a[3]=31;
    a[4]=30;
    a[5]=31;
    a[6]=30;
    a[7]=31;
    a[8]=31;
    a[9]=30;
    a[10]=31;
    a[11]=30;
    a[12]=31;
    t=0;
    i=0;
    while (t<=11)
    {
    i=i+1;
    t=t+1;
    scanf("%d",&a[i]);
      if(w==7)
        {
         printf("%d\n",t);
         w=((w+a[i])%7)+7;
         }
      else
         w=((w+a[i])%7)+7;
     }

       return 0;
}
int main()
{
	int i,w,a[12];
	a[0]=12;
	a[1]=12+31;
	a[2]=12+31+28;
	a[3]=12+31+28+31;
	a[4]=12+31+28+31+30;
	a[5]=12+31+28+31+30+31;
	a[6]=12+31+28+31+30+31+30;
	a[7]=12+31+28+31+30+31+30+31;
	a[8]=12+31+28+31+30+31+30+31+31;
	a[9]=12+31+28+31+30+31+30+31+31+30;
	a[10]=12+31+28+31+30+31+30+31+31+30+31;
	a[11]=12+31+28+31+30+31+30+31+31+30+31+30;

	scanf("%d",&w);
	for(i=0;i<12;i++)
	{
		if((w+a[i])%7==5)
			printf("%d\n",i+1);

	}
	return 0;


}
int Month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int main()
{
	int D;
	scanf ("%d", &D);D --;
	for (int i = 0; i < 12; i ++)
		for (int j = 1; j <= Month[i]; j ++)
		{
			D ++;
			if (D % 7 == 5 && j == 13) printf ("%d\n", i + 1);
		}
	return 0;
}
int main()
{
	int month[12]={31,28,31,30,31,30,31,31,30,31,30,31},n,m,first[12],i;
	scanf("%d",&first[0]);
	for(i=0;i<12;i++)
	{
		switch(month[i])
		{
		case 31:
			if(first[i]+3<=7)
			{
				first[i+1]=first[i]+3;
			}
			else
			{
				first[i+1]=first[i]+3-7;
			}
			break;
		case 30:
			if(first[i]+2<=7)
			{
				first[i+1]=first[i]+2;
			}
			else
			{
				first[i+1]=first[i]+2-7;
			}
			break;
		case 28:
			first[i+1]=first[i];
			break;
		}
	}
	for(i=0;i<12;i++)
	{
		if(first[i]<=2)
		{
			first[i]=first[i]+12-7;
		}
		else 
			first[i]=first[i]+12-14;
		if(first[i]==5)
		{
			printf("%d\n",i+1);
		}
	}
	return 0;
}
int main ()
{
	int w,t;
	scanf ("%d",&w);
	int month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int m;
	m = 13%7+w-1;
	if (m>7) m = m-7;
    if (m==5) printf ("1\n");
	int i,j,day[12]={0};
	for (i=1;i<12;i++)
	{
		for (j=0;j<i;j++)
			day[i] += month[j];
		day[i] += 13;
		t = day[i]%7+w-1;
		if (t>7) t = t-7;
		if (t==5) printf ("%d\n",i+1);
	}
	
	return 0;
}
void main(void)
{
	int w;
	scanf("%d",&w);

	int day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

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

		if ((days+w-5)%7 == 0)
			printf("%d\n" , i);
	}

	return 0;
}