semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int w,a,x=0,i;
	scanf("%d",&w);
	a=5-w;
	if(a<0)
	{
		a=a+7;
	}
	if(12%7==a)
	{
		printf("1\n");
	}
	for(i=1;i<12;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10)
		{
			x=x+31;
		}
        else if(i==4||i==6||i==9||i==11)
		{
			x=x+30;
		}
		else if(i==2)
		{
			x=x+28;
		}
		if((x+12)%7==a)
		{
			printf("%d\n",i+1);
		}
	}	
	return 0;
}
void main()
{
 int w,i,j,a[12][31],b[12][31],c[12*31],d[12*31];
 scanf("%d",&w);
 for(i=0;i<12;i++)
  for(j=0;j<31;j++)
   a[i][j]=j+1;
    for(j=28;j<31;j++)
  a[1][j]=0;
    for(i=0;i<12;i++)
 if(i==3 || i==5 || i==8 || i==10)
  a[i][30]=0;
    for(i=0;i<12*31;i++)
 d[i]=a[i/31][(i+31)%31];
 c[0]=w;
 for(i=1;i<12*31;i++)
    {
     if(d[i]==0) c[i]=c[i-1];
  else c[i]=c[i-1]+1;
        if(c[i]>=8) c[i]=c[i]-7;
     }
   for(i=0;i<12*31;i++)
 b[i/31][(i+31)%31]=c[i];
 for(i=0;i<12;i++)
  for(j=0;j<31;j++)
 if(b[i][j]==5 && a[i][j]==13)
     printf("%d\n",i+1);
}
//?????
void main()
{
	int week(int w,int n);
	int w,i,r=0,unlucky[12];

	scanf("%d",&w);
	
	if(week(w,13)==5)
	{
		unlucky[r]=1;
		r++;
	}
	if(week(w,44)==5)
	{
		unlucky[r]=2;
		r++;
	}
	for(i=3;i<=7;i++)
	{
		if(i%2!=0)
		{
			if(week(w,13+31*(i-1)/2+28+30*(i-3)/2)==5)
			{
				unlucky[r]=i;
				r++;
			}
		}
		else
		{
			if(week(w,13+31*i/2+28+(i-4)*15)==5)
			{
				unlucky[r]=i;
				r++;
			}
		}
	}
	for(i=8;i<=12;i++)
	{
		if(i%2!=0)
		{
			if(week(w,225+31*(i-7)/2+(i-9)*15)==5)
			{
				unlucky[r]=i;
				r++;
			}
		}
		else
		{
			if(week(w,225+31*(i-8)/2+15*(i-8))==5)
			{
				unlucky[r]=i;
				r++;
			}
		}
	}

	for(i=0;i<r;i++)
		printf("%d\n",unlucky[i]);
}

int week(int w,int n)
{
	int t,i;
	t=(n-1)%7;
	i=t+w;
	if(i>7)
		return(i-7);
	else
		return(i);
}
int main()
{
	int w,m,d,x;
	scanf("%d",&w);
	x=w;
	m=1;
	d=1;
	while (m<13)
	{
		if ((d==13)&&(x==5))
			printf("%d\n",m);
		d++;
		x++;
		if (x==8)
			x=1;
		if ((m==1)||(m==3)||(m==5)||(m==7)||(m==8)||(m==10)||(m==12))
		{
			if (d==32)
			{
				d=1;
				m++;
			}
		}
		else if ((m==4)||(m==6)||(m==9)||(m==11))
		{
			if (d==31)
			{
				d=1;
				m++;
			}
		}
		else if ((m==2)&&(d==29))
		{
			d=1;
			m++;
		}
	}
	return 0;
}
int main(){
	int d[12][13]={0},m,i;
	scanf("%d",&d[0][0]);
	if(d[0][0]==7)d[0][0]=0;
	d[1][0]=(d[0][0]+3)%7;
	d[2][0]=d[1][0];
	d[3][0]=(d[2][0]+3)%7;
	d[4][0]=(d[3][0]+2)%7;
	d[5][0]=(d[4][0]+3)%7;
	d[6][0]=(d[5][0]+2)%7;
	d[7][0]=(d[6][0]+3)%7;
	d[8][0]=(d[7][0]+3)%7;
	d[9][0]=(d[8][0]+2)%7;
	d[10][0]=(d[9][0]+3)%7;
	d[11][0]=(d[10][0]+2)%7;
	for(m=0;m<12;m++){
		for(i=1;i<13;i++){
			d[m][i]=(d[m][i-1]+1)%7;
		}
		if(d[m][12]==5)
			printf("%d\n",m+1);
		}
	return 0;
}
//********************
//*****?????*****
//**?? 1100012915***
//*******11.7*********
//********************
int main()
{
	int i,first;//first???????
	int mon[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};//?????
	int every13[13];//??????13?????
	cin >> first;
	every13[1] = first + 12 % 7 ;//??????
	if ( every13[1] > 7 )
		every13[1] = every13[1] - 7 ;//??7????7
	for ( i = 2 ; i <= 12 ; i ++ )//??2~12?13?????
	{
		every13[i] = every13[i - 1] + mon[i - 1] % 7 ;
		if ( every13[i] > 7)
			every13[i] = every13[i] - 7;
	}
	for ( i = 1 ; i <= 12 ; i ++ )
		if ( every13[i] == 5 )//????????????????
			cout << i <<endl;
	return 0;
}
// ?????
// ??? 1100012820
// 20111102
//******************
int main()
{
	int w;
	cin >> w;
	int i = 0, days = 0;
	for (; i <= 11; i++)
	{
		switch(i)
		{
		case 0: days += 12; break;
		case 1: 
		case 3:
		case 5:
		case 7:
		case 8:
		case 10: days += 31; break;
		case 6:
		case 9:
		case 11:
		case 4: days += 30; break;
		case 2: days += 28; break;
		}
		if ((days % 7 + w) % 7 == 5)
			cout << i + 1 << endl;
	}
	return 0;
}
main()
{
    int n,ans;
    scanf("%d",&n);
    ans = (n+12)%7;
    if (ans == 5)
        printf("1\n");
    for (int i = 1;i <= 11;i ++)
    {
        if (i==1||i==3||i==5||i==7||i==8||i==10||i==12)
            ans=(ans+31)%7;
        else if(i==2)
            ans=(ans+28)%7;
        else
            ans=(ans+30)%7;
        if (ans==5)
            printf("%d\n",i+1);
    }
        
}
int main()
{
	int w,days[12]={31,28,31,30,31,30,31,31,30,31,30,31},i,j,date[12]={0};
	scanf("%d",&w);
	date[0]=w+5;
	while(date[0]>7)
	{
		date[0]=date[0]-7;
	}
	for(i=1;i<12;i++)
	{
		date[i]=(days[i-1]%7)+date[i-1];
		while(date[i]>7)
		{
			date[i]=date[i]-7;
		}
	}
	for(i=0;i<12;i++)
	{
		if(date[i]==5)
		{
			printf("%d\n",i+1);
		}
	}
	return 0;
}
int main(int argc, char* argv[])
{
	int week;
	scanf("%d",&week);
	int i;
	int day=0;
	int dy;
	for(i=1;i<=12;i++)
	{
	
		dy=day+12+week;
		if(dy%7==5)
		{
			printf("%d\n",i);
		}	if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			day=day+31;
		}
		else if(i==2)
		{
			day=day+28;
		}
		else if(i==4||i==6||i==9||i==11)
		{
			day=day+30;
		}
	}
	return 0;
}
int main(int argc, char* argv[])
{
	int n;
	scanf("%d",&n);
	if((n+12)%7==5)printf("1\n");
    if((n+12+31)%7==5)printf("2\n");
    if((n+12+59)%7==5)printf("3\n");
    if((n+12+90)%7==5)printf("4\n");
    if((n+12+120)%7==5)printf("5\n");
    if((n+12+151)%7==5)printf("6\n");
    if((n+12+181)%7==5)printf("7\n");
    if((n+12+212)%7==5)printf("8\n");
    if((n+12+243)%7==5)printf("9\n");
    if((n+12+273)%7==5)printf("10\n");
    if((n+12+304)%7==5)printf("11\n");
    if((n+12+334)%7==5)printf("12\n");
	return 0;
}
int main ()
{
int w,i;
int s[365];

scanf ("%d",&w);

for (i=1;i<366;i++)
{s[i]=w+i-1;

while (s[i]>7)
	{s[i]=s[i]-7;}

if(i<=31)
	{if((i==13)&&(s[i]==5))
		printf("1\n");
	}

else if(i-31<=28)
	{if((i-31==13)&&(s[i]==5))
		printf("2\n");
	}

else if(i-31-28<=31)
	{if((i-31-28==13)&&(s[i]==5))
		printf("3\n");
	}

else if(i-31-28-31<=30)
	{if((i-31-28-31==13)&&(s[i]==5))
		printf("4\n");
	}
else if(i-31-28-31-30<=31)
	{if((i-31-28-31-30==13)&&(s[i]==5))
		printf("5\n");
	}
else if(i-31-28-31-30-31<=30)
	{if((i-31-28-31-30-31==13)&&(s[i]==5))
		printf("6\n");
	}
else if(i-31-28-31-30-31-30<=31)
	{if((i-31-28-31-30-31-30==13)&&(s[i]==5))
		printf("7\n");
	}
else if(i-31-28-31-30-31-30-31<=31)
	{if((i-31-28-31-30-31-30-31==13)&&(s[i]==5))
		printf("8\n");
	}
else if(i-31-28-31-30-31-30-31-31<=30)
	{if((i-31-28-31-30-31-30-31-31==13)&&(s[i]==5))
		printf("9\n");
	}
else if(i-31-28-31-30-31-30-31-31-30<=31)
	{if((i-31-28-31-30-31-30-31-31-30==13)&&(s[i]==5))
		printf("10\n");
	}
else if(i-31-28-31-30-31-30-31-31-30-31<=30)
	{if((i-31-28-31-30-31-30-31-31-30-31==13)&&(s[i]==5))
		printf("11\n");
	}
else if(i-31-28-31-30-31-30-31-31-30-31-30<=31)
	{if((i-31-28-31-30-31-30-31-31-30-31-30==13)&&(s[i]==5))
		printf("12\n");
	}

}

return 0;
}
int main()
{
	int w, A[12], i;
	int a;
	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;
	scanf("%d", &w);
	for(i=1;i<=12;i++)
	{
		a=(A[i]-7+w)%7;
        if(a==5)
		{
			printf("%d\n",i);
		}
	}
	return 0;
}
int main(){
int n,a;
scanf("%d",&n);
for(int x=1;x<=12;x++){
if(x==1){
a=(13+n-1)%7;
if(a==5){printf("1\n");}}
else if(x==2){
a=(31+13+n-1)%7;
if(a==5){printf("2\n");}}
else if(x==3){
a=(31+28+13+n-1)%7;
if(a==5){printf("3\n");}}
else if(x==4){
a=(31*2+28+13+n-1)%7;
if(a==5){printf("4\n");}}
else if(x==5){
	a=(31*2+28+30+13+n-1)%7;
if(a==5){printf("5\n");}}
else if(x==6){
a=(31*3+28+30+13+n-1)%7;
if(a==5){printf("6\n");}}
else if(x==7){
a=(31*3+28+30*2+13+n-1)%7;
if(a==5){printf("7\n");}}
else if(x==8){
a=(31*4+28+30*2+13+n-1)%7;
if(a==5){printf("8\n");}}
else if(x==9){
a=(31*5+28+30*2+13+n-1)%7;
if(a==5){printf("9\n");}}
else if(x==10){
a=(31*5+28+30*3+13+n-1)%7;
if(a==5){printf("10\n");}}
else if(x==11){
a=(31*6+28+30*3+13+n-1)%7;
if(a==5){printf("11\n");}}
else if(x==12){
a=(31*6+28+30*4+13+n-1)%7;
if(a==5){printf("12\n");}}
}
return 0;
}
int main()
{
    int w;
    int i,j;
    int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    scanf("%d",&w);
    w--;
    for (i=0;i<12;i++)
        for (j=1;j<=day[i];j++)
            {
               w++;
               if (w>7) w=w-7;
               if ((j==13)&&(w==5))
                  printf("%d\n",i+1);
            }
}
int DiJiTian(int x);
int main (){
	int w,i,m,n,y;
	scanf("%d",&w);
	for(i=1;i<=12;i++){
	   y=DiJiTian(i)-1;
	   m=y%7;
	   n=m+w;
	   if(n>7){
	     n=n-7;
	   }
	   if(n==5){
	       printf("%d\n",i);
	   }
	}
   
return 0;
}
int DiJiTian(int x){
  int result;
  int j;
  if(x==1){result=13;}
  else{
	  result=0;
	  for (j=1;j<x;j++){
		  if(j==1||j==3||j==5||j==7||j==8||j==10||j==12){
		      result+=31;
		  }
		  else if(j==4||j==6||j==9||j==11){
		      result+=30;
		  }
		  else if(j==2){
		      result+=28;
		  }
	  }
	  result+=13;
  }
  return result;
}
int yf(int k);
int main()
{
	int i,n,w;
	scanf("%d",&w);
	for(i=0;i<12;i++){
		n=(yf(i)+12)%7+w;
		if(n>7){
			n=n-7;
		}
		if(n==5){
			printf("%d\n",i+1);
		}
	}
	return 0;
}
int yf(int k){
	int t,j;
	t=0;
	for(j=0;j<k;j++){
		if(j==0||j==2||j==4||j==6||j==7||j==9||j==11){
			t+=31;
		}else if(j==3||j==5||j==8||j==10){
			t+=30;
		}else if(j==1){
			t+=28;
		}
	}
	return t;
}
int main()
{
    int w,i;
    int a[12],k[12];
    a[0]=k[0]=0;
    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);   
    for(i=1;i<=12;i++){
        k[i]=k[i-1]+a[i-1];
        if((k[i]+w)%7==0)
        printf("%d\n",i);
        }
        return 0;
}
int main()
{
	int w,i,d=0;
	scanf("%d",&w);
	for(i=1;i<13;i++)
	{
		d=0;
		switch(i)
		{
		case 12:d+=30;
		case 11:d+=31;
		case 10:d+=30;
		case 9:d+=31;
		case 8:d+=31;
		case 7:d+=30;
		case 6:d+=31;
		case 5:d+=30;
		case 4:d+=31;
		case 3:d+=28;
		case 2:d+=31;
		case 1:d=d-1;
		}
		d+=13;
		d=d%7+w;
		if(d>7)
		{
			d=d-7;
		}
		if(d==5)
		{
			printf("%d\n",i);
		}
	}
	return 0;
}
int main (){
	int w,i,sum=13;
	scanf("%d",&w);
	if((13+w-1)%7==5){
		printf("1\n");
	}
	for (i=2;i<=12;i++){
	   if(i-1==1||i-1==3||i-1==5||i-1==7||i-1==8||i-1==10){
			sum+=31;
	   }else if(i-1==2){
			sum+=28;
            }else{
			sum+=30;
	   }
	   if((sum+w-1)%7==5){
		printf("%d\n",i);
	   }
	}
	return 0;
}
int main(){
	int w,m;
	scanf("%d",&w);
	for(m=1;m<=12;m++){
		if(m==1||
		   m==3||
		   m==5||
		   m==7||
		   m==8||
		   m==10||
		   m==12){
	    	if((w+12)%7==5){
	    		printf("%d\n",m);
	    	}
	    	w=(w+31)%7;
		}
		if(m==4||
		   m==6||
		   m==9||
		   m==11){
			if((w+12)%7==5){
				printf("%d\n",m);
			}
			w=(w+30)%7;
	    }
		if(m==2){
			if((w+12)%7==5){
				printf("%d\n",m);
			}
			w=(w+28)%7;
		}
	}
	return 0;
}
void main()
{
	int year[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	int w;
	int i,j=0,k=0;
	scanf("%d",&w);
	for(i=0;i<365;i++)
	{
		j++;
		if(j>year[k])
		{
			j-=year[k];
			k++;
		}
		if((i+w)%7==5 && j==13) printf("%d\n",k+1);
	}
	

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

}
int main(){
	int w,i,j;
	scanf("%d",&w);
	for(j=1;j<=12;j++){
		int days[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
			int a=0;
		for(i=0;i<j;i++){
			a+=days[i];
		}
		a=a+12;
		if((a+w)%7==5){
			printf("%d\n",j);
		}
	}
	return 0;
}
//********************************
//*????1.cpp                ** 
//*????????             **
//*?????? 1200012834      **
//*???2012.11.9              **
//********************************

int main()
{
	int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int a[12] = {13};
	int w, i;
	for (i = 1; i <= 11; i++)
	{
		a[i] = a[i-1] + days[i-1];
	}
	cin >> w;
	for (i = 0; i <= 11; i++)
	{
		if((a[i] - 1 + w) % 7 == 5)
		{
			cout << i+1 << endl;
		}
	}
	return 0;
}
int main()
{
	int w,i,j,a[12],day=0;
	scanf("%d",&w);
	a[0]=0;
	a[1]=a[3]=a[5]=a[7]=a[8]=a[10]=31;
	a[2]=28,a[4]=a[6]=a[9]=a[11]=30;
	for(j=1;j<=12;j++)
	{
		day=0;
		for(i=0;i<j;i++)
			day=day+a[i];
		if(((day+12)+w)%7==5)
			printf("%d\n",j);
	}
	return 0;
}
main()
{
      int d,i,w;
      scanf("%d",&w);
      d=(w+5)%7;
      for(i=1;i<=12;i++)
      {
                        if(d%7==5) printf("%d\n",i);
                        if(i==2)
                        d=d+7;
                        else if(i==4||i==6||i==9||i==11)
                        d=d+2;
                        else d=d+3;
                        
                        }
                                                }
int main()
{
	int days[12]={13,44,72,103,133,164,194,225,256,286,317,347};
	int i,w;
         scanf("%d",&w);
	for(i=0;i<12;i++){
		if(days[i]%7+w==6||days[i]%7+w==13){
			printf("%d\n",i+1);
		}
	}
		return 0;
}
int main()
{
	int monthdays[2][13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int i,sum=0,w;
	cin >> w;
	for(i=0;i<=11;i++)
	{
		sum+=monthdays[0][i];
		monthdays[1][i]=sum+12+w;
		if(monthdays[1][i]==5||monthdays[1][i]%7==5)
			cout << i+1 << endl;
	}
	return 0;
}
int main()
{
    int w,m,d,a;
    w=0;
    m=1;
    d=0;
    a=1;
    scanf("%d",&w);
    w=w-1;
    d=d+13;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
    d=d+31;
    m=m+1;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
    d=d+28;
    m=m+1;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
    d=d+31;
    m=m+1;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
    d=d+30;
    m=m+1;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
    d=d+31;
    m=m+1;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
    d=d+30;
    m=m+1;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
    d=d+31;
    m=m+1;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
    d=d+31;
    m=m+1;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
    d=d+30;
    m=m+1;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
    d=d+31;
    m=m+1;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
    d=d+30;
    m=m+1;
    a=(d-(d/7)*7+w);
    if(a==5) printf("%d\n",m);
    if(a==12) printf("%d\n",m);
}
int main(int argc, char* argv[])
{
	int i, w, total[12], j;
	scanf("%d",&w);
	for(j=0; 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 || i==12)
		{
				total[j] = total[j] +31;
		}
		if ( i ==4 || i==6 || i==9 || i==11)
		{
				total[j] = total[j] +30;
		}
		 if ( i ==2)
		{			
			total[j] = total[j] +28;
		}
	 }
     if(w<=5){
	    if(total[j]%7==(5-w)){
		 printf("%d\n",j+1);
		}
     }
	 if(w>5){
        if(total[j]%7==(12-w)){
		 printf("%d\n",j+1);
		}
	 }
	}
	return 0;
}
void main()
{
	int n,i,t,a[12]={13,44,72,103,133,164,194,225,256,286,317,347};
	scanf("%d",&n);
	for(i=0;i<12;i++)
	{
		t=a[i]%7;
		if((t+n<=8 && t+n-1==5) || t+n>8 && t+n-7-1==5)
			printf("%d\n",i+1);
	}
}
int main ()
{
	int a[15], i, j, w, t, days, k = 0, c[15], m; 
	a[0] = 0; 
	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; 
	cin >> w; 
	t = 8 - w; 
	if ( ( 13 - t ) % 7 == 5 )
	{
		k++; 
		c[k] = 1; 
	}
	if ( ( 44 - t ) % 7 == 5 )
	{
		k++; 
		c[k] = 2; 
	}
	for ( i = 3; i <= 12; i++ )
	{
		days = 13; 
		for ( j = 2; j < i; j++ )
		{
			days += a[j]; 
		} 
		days += 31 - t;  
		if ( days % 7 == 5 )
		{
			k++; 
			c[k] = i; 
		}
	}
	for ( i = 1; i <= k; i++ )
		cout << c[i] << endl;  
	return 0; 
}
main()
{
	int i,w,day[12];
	int mon[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d",&w);
	day[0]=13;
	for(i=1;i<12;i++)
		day[i]=day[i-1]+mon[i-1];
	for(i=0;i<12;i++)
		if((day[i]+w)%7==6)
			printf("%d\n",i+1);
	return 0;
}
int main()
{int w,i,day,k,t;
scanf("%d",&w);

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

}
int diji( int month, int day){
	int i,s=0;
	for(i=1;i<month;i++){
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			s=s+31;
		}
		if(i==4||i==6||i==9||i==11){
			s=s+30;
		}
		if(i==2){
			s=s+28;
		}
	}
	s=s+day;
	return s;
}
int main(){
	int n,days,mon,date,m,j;
	scanf("%d",&n);
	for(j=1;j<=12;j++){
	days=0;
    days=diji(j,13);
	m=days%7;
	if((m+n-1==5)||((m+n-1)%7==5)){
		printf("%d\n",j);
	}
	}
	return 0;
}
main()
{
      int w;
      scanf("%d",&w);
      if((5+w)%7==5)
        printf("1\n");
      if((1+w)%7==5)
       printf("2\n3\n");
      if((4+w)%7==5)
       printf("4\n");
       if((6+w)%7==5)
       printf("5\n");
       if((2+w)%7==5)
       printf("6\n");
       if((4+w)%7==5)
       printf("7\n");
       if((7+w)%7==5)
       printf("8\n");
       if((3+w)%7==5)
       printf("9\n");
       if((5+w)%7==5)
       printf("10\n");
       if((1+w)%7==5)
        printf("11\n");
       if((3+w)%7==5)
        printf("12\n");
       
       return 0;
}
// &sup2;&raquo;&frac14;&ordf;&Agrave;&ucirc;&Ecirc;&yacute;×&Ouml;.cpp : Defines the entry point for the console application.
//
int main(int argc, char* argv[])
{
	int first,i,day=13;
	scanf("%d",&first);
	for(i=1;i<=12;i++){
		if(i==2||i==4||i==6||i==8||i==9||i==11){
			day+=31;
		}
		if(i==3)day+=28;
		if(i==5||i==7||i==10||i==12){
			day+=30;
		}
		if((day%7-1+first)%7==5)printf("%d\n",i);
	}
	return 0;
}
int main()
{
	int month[12];
	int w, days = 0, i, flag = 0;
	cin >> w;
	for (i = 1; i <= 12; i++)
	{
		switch(i)
		{
			case 3: days += 28; break;
			case 5:
			case 7:
			case 10:
			case 12: days += 30; break;
			case 2: 
			case 4:
			case 6:
			case 8:
			case 9:
			case 11: days += 31; break;
		}
		month[i -1] = ((days + 12) % 7 + w) % 7;
		if (month[i - 1] == 5)
		{
			cout << i << endl;
		}
	}
	return 0;
}
void main()
{
	int w,month[12],n,i=0;
	scanf("%d",&w);
	w=w+12;
	if((w)%7==5)
	{month[i]=1;
	i++;}
	w=w+3;
	if(w%7==5)
	{month[i]=2;
	i++;
	month[i]=3;
	i++;}
	w=w+3;
	if(w%7==5)
	{month[i]=4;
	i++;}
	w=w+2;
	if(w%7==5)
	{month[i]=5;
	i++;}
	w=w+3;
	if(w%7==5)
	{month[i]=6;
	i++;}
	w=w+2;
	if(w%7==5)
	{month[i]=7;
	i++;}
	w=w+3;
	if(w%7==5)
	{month[i]=8;
	i++;}
	w=w+3;
	if(w%7==5)
	{month[i]=9;
	i++;}
	w=w+2;
	if(w%7==5)
	{month[i]=10;
	i++;}
	w=w+3;
	if(w%7==5)
	{month[i]=11;
	i++;}
	w=w+2;
	if(w%7==5)
	{month[i]=12;
	i++;}
	n=i;
	for(i=0;i<n;i++)
		printf("%d\n",month[i]);
}
int main()
{
 int w,n;
 scanf("%d",&w);
 n=w+5;
 if(n>7)
 n -= 7;
 if(n==5)
 printf("1\n");
 n+=3;
 if(n>7)
 n -= 7;
 if(n==5)
 printf("2\n3\n");
  n+=3;
 if(n>7)
 n -= 7;
 if(n==5)
 printf("4\n");
  n+=2;
 if(n>7)
 n -= 7;
 if(n==5)
 printf("5\n");
  n+=3;
 if(n>7)
 n -= 7;
 if(n==5)
 printf("6\n");
  n+=2;
 if(n>7)
 n -= 7;
 if(n==5)
 printf("7\n");
  n+=3;
 if(n>7)
 n -= 7;
 if(n==5)
 printf("8\n");
  n+=3;
 if(n>7)
 n -= 7;
 if(n==5)
 printf("9\n");
  n+=2;
 if(n>7)
 n -= 7;
 if(n==5)
 printf("10\n");
  n+=3;
 if(n>7)
 n -= 7;
 if(n==5)
 printf("11\n");
  n+=2;
 if(n>7)
 n -= 7;
 if(n==5)
 printf("12\n");
 return 0;
}
int dijitian(int m,int d)
{
	int i,sum=0;
	for(i=1;i<=m-1;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			sum+=31;
		}
		if(i==2)
		{
			sum+=28;
		}
		if(i==4||i==6||i==9||i==11)
		{
			sum+=30;
		}
	}
	sum+=d;
	return sum;
}
int main()
{
	int w,k,i,p;
	scanf("%d",&w);
	for(i=1;i<=12;i++)
	{
		k=dijitian(i,13)-dijitian(1,1);
		p=k;
		while(p>=7)
		{
			p=p-7;
		}
		if(((p+w)%7)==5)
		{
			printf("%d\n",i);
		}
		
	}
	return 0;
}
/* title:?????*
 * author:???*
 * time:2011.10.28*/


   


int main()
{
	int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	int day[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
	int week[13] = {0};
	int weekday, i, j;
	cin >> weekday;
	for(i = 1; i <= 12; i ++)
	{
		for(j = 1; j < i; j++)
		{
			day[i] = day[i] + month[j];
		}
		day[i] = day[i] + 12;
		week[i] = (day[i] % 7 + weekday) % 7;
		if(week[i] == 5)
			cout << i << endl;
	}
	return 0;
}
int main()
{
   int w,n;
   scanf("%d",&w);
   int i=1,x=0;
   while(i<=12){
     if(i==1){
       n=(12%7+w)%7;
     }else if(i==2||i==4||i==6||i==8||i==9||i==11){
       x=x+31;
       n=((12+x)%7+w)%7;
     }else if(i==3){
       x=x+28;
       n=((12+x)%7+w)%7;
     }else{
       x=x+30;
       n=((12+x)%7+w)%7;
     }
     if(n==5){
       printf("%d\n",i);
     }
     i++;
   }
   return 0;
}
int main()
{
	int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
		days[12] = {0}, w;
	cin >> w;
	for (int i = 1; i < 12; i++)
	{
		days[i] = days[i - 1] + mon[i - 1];
	}
	for (int j = 0; j < 12; j++)
	{
		if ( (days[j] + 13 - 1) % 7 + w == 5 || (days[j] + 13 - 1) % 7 + w == 12)
		{
			cout << j + 1 << endl;
		}
	}
	return 0;
}
int main()
{
	int i,j,m,sum[13],da[13]={0},x;
	scanf("%d",&m);
	for(i=1;i<=12;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10)
		    sum[i]=31;
		else if(i==2)
			sum[i]=28;
		else sum[i]=30;
	}
	for(i=1;i<=12;i++)
	{
		for(j=1;j<i;j++)
			da[i]+=sum[j];
		da[i]+=12;
	}
	for(i=1;i<=12;i++)
	{
		x=m+da[i]%7;
		if(x==5||x==12)printf("%d\n",i);
	}
}
int main() 
{
	int w,i,j;
	int a[13][32];
	scanf("%d",&w);
	a[0][0]=w;
	for(i=1;i<=12;i++)
	{
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		{
			for(j=1;j<=31;j++)
			{
				a[i][j]=w;
				if(w==7)
					w=1;
				else
					w+=1;
			}
		}
		if(i==4||i==6||i==9||i==11)
		{
			for(j=1;j<=30;j++)
			{
				a[i][j]=w;
				if(w==7)
					w=1;
				else
					w+=1;
			}
		}
		if(i==2)
		{
			for(j=1;j<=28;j++)
			{
				a[i][j]=w;
				if(w==7)
					w=1;
				else
					w+=1;
			}
		}
	}
	for(i=1;i<=12;i++)
	{
		if(a[i][13]==5)
		{
			printf("%d\n",i);
		}
	}
	return 0;

}
int  main( )
{
	int i,n,w,xq[13];
	n=0;
	scanf("%d",&w);
	n+=w-1;
	xq[1]=13;
	xq[2]=31+13;
	xq[3]=31+28+13;
	xq[4]=31+28+31+13;
	xq[5]=31+28+31+30+13;
	xq[6]=31+28+31+30+31+13;
	xq[7]=31+28+31+30+31+30+13;
	xq[8]=31+28+31+30+31+30+31+13;
	xq[9]=31+28+31+30+31+30+31+31+13;
	xq[10]=31+28+31+30+31+30+31+31+30+13;
	xq[11]=31+28+31+30+31+30+31+31+30+31+13;
	xq[12]=31+28+31+30+31+30+31+31+30+31+30+13;
	for(i=1;i<13;i++){
		xq[i]+=n;
		if(xq[i]%7==5){
			printf("%d\n",i);
		}
	}
	return 0;
}
void main()
{int n,m,j,i,k=0,sum=0,d[]={31,28,31,30,31,30,31,31,30,31,30,31},c[12],y[365],x[53];
scanf("%d",&n);
m=n;
for(i=0;i<12;i++)
{c[i]=sum+13;
sum=sum+d[i];}
for(j=0;j<365;j++)
{y[j]=j+1;}
for(i=0;i<365;i++)
{
if(m==5)
{x[k]=y[i];
k=k+1;}
m=m+1;
if(m==8)
m=1;
}
for(i=0;i<12;i++)
{for(j=0;j<53;j++)
if(c[i]==x[j])
printf("%d\n",i+1);
}
}
int main()
{
	int w,a[100]={0},i,k,sum;
	scanf("%d",&w);
	if(w==1||w==2||w==3||w==4||w==5)a[0]=6-w;
	else if(w==6)a[0]=7;
	else if(w==7)a[0]=6;
	int m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	a[1]=0;
	for(i=1;a[i-1]<=365;i++)
	{
		a[i]=a[i-1]+7;
		sum=13;
		for(k=0;k<=11;k++)
		{
			sum+=m[k];
			if(a[i]==sum)
				printf("%d\n",k+1);
		}
	}
	return 0;
}
void main()
{   
	void xunzhao(int a[]);
	int i,k,a[12]={5,3,0,3,2,3,2,3,3,2,3,2};
	scanf("%d",&k);
	if(k+5>7) a[0]=k-2;
	else      a[0]=k+5;
	for(i=1;i<12;i++)
	switch(a[i])
	{case 3:if(a[i-1]+3<8) a[i]=a[i-1]+3;
	       else a[i]=a[i-1]-4; break;
    case 0:a[i]=a[i-1];break;
	case 2:if(a[i-1]+2<8) a[i]=a[i-1]+2;
	       else a[i]=a[i-1]-5; break;
	}
	xunzhao(a);
}

void xunzhao(int a[])
{   int i;
	for(i=0;i<12;i++)
		if(a[i]==5)
			printf("%d\n",i+1);
}