semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	int n,tian[1000],qi[1000];
	int i,*p,*q,*p1,*q1,sum,t,temp;
	while(1)
	{
		sum=0;
		
		scanf("%d",&n);
if(n==0)
return;
		for(i=0;i<n;i++)
		{
			scanf("%d",&tian[i]);
		}
		for(i=0;i<n;i++)
		{
			scanf("%d",&qi[i]);
		}
		t=n;
		while(t--)
		{
			for(i=0;i<t;i++)
			{
				if(tian[i]<tian[i+1])
				{
					temp=tian[i];
					tian[i]=tian[i+1];
					tian[i+1]=temp;
				}
			}
			for(i=0;i<t;i++)
			{
				if(qi[i]<qi[i+1])
				{
					temp=qi[i];
					qi[i]=qi[i+1];
					qi[i+1]=temp;
				}
			}

		}
		p=tian+n-1;
		p1=tian;
		q=qi+n-1;
		q1=qi;
		while(p>=p1)
		{
			if(*p>*q)
			{
				sum=sum+200;
				p--;q--;
			}
			else if(*p<*q)
			{
				sum=sum-200;
				p--;
				q1++;
			}
			else if(*p==*q)
			{
				if(*p1>*q1)
				{
					sum=sum+200;
					p1++;q1++;
				}
				else if(*p1<*q1)
				{
					sum=sum-200;
					p--;
					q1++;
				}
				else if(*p1==*q1)
				{
					if(*p1==*p)
					{
						sum=sum+0;
						break;
					}
					else
					{
						sum=sum-200;
						p--;
						q1++;
					}
				}
			}
			
		}
		printf("%d\n",sum);
	}
}
int q[maxlen], t[maxlen];
int f[maxlen][maxlen];// f[i][j]??????i?????????j?????i-j????????
// ????????????????????????????????????
int n, sum, maxi;
int g(int, int);
int main()
{
	int ncount = 1;
	while(cin >> n && n)
	{
		for(int i = 0;i < n; ++i)
			cin >> t[i];
		for(int i = 0;i < n; ++i)
			cin >> q[i];
		sort(q, q + n);
		sort(t, t + n);
		f[0][0] = 0;
		sum = 0;
		for(int i = 1;i <= n;++i)
		{
			if(q[n - i] > t[i - 1])
				sum -= 200;
			else if(q[n - i] < t[i - 1])
				sum += 200;
			f[i][0] = sum;
		}
		sum = 0;
		for(int i = 1;i <= n;++i)
		{
			if(q[n - i] > t[n - i])
				sum -= 200;
			else if(q[n - i] < t[n - i])
				sum += 200;
			f[i][i] = sum;
		}

		for(int i = 2;i <= n; ++i)
			for(int j = 1;j < i; ++j)
				f[i][j] = max(f[i - 1][j] + g(n - i, i - j - 1), f[i - 1][j - 1] + g(n - i, n - j ));

		maxi = -999999999;
		for(int i = 0; i <= n; ++i)
			if(f[n][i] > maxi)
				maxi = f[n][i];
		cout << maxi << endl;
		ncount++;
	}
	return 0;
}
int g(int qi, int tian)
{
	if(q[qi] > t[tian])
		return -200;
	if(q[qi] < t[tian])
		return 200;
	return 0;
}
int cmp(const void *a, const void *b) {return(*(int *)a-*(int *)b);} 
main(){
	int n,i,j,flag,max,maxnum,money,t[1001],q[1001];
	while(1){
		scanf("%d",&n);
		if(!n)break;
		for(i=0;i<n;i++)scanf("%d",&t[i]);
		for(i=0;i<n;i++)scanf("%d",&q[i]);
		qsort(t,n,sizeof(t[0]),cmp);
		qsort(t,n,sizeof(q[0]),cmp);
		money=0;
		//? 
		for(i=0;i<n;i++){
			flag=0;
			max=-100;maxnum=-1;
			for(j=0;j<n;j++){
				if(q[j]<t[i]&&q[j]>max){
					max=q[j];maxnum=j;flag=1;
				}
			}
			if(flag){
				t[i]=-100;q[maxnum]=-100;money+=200;
			}
		}
		//?
		for(i=0;i<n;i++){
			if(t[i]==-100)continue;
			for(j=0;j<n;j++){
				if(q[j]==-100)continue;
				if(t[i]==q[j]){
					t[i]=-100;q[j]=-100;break;
				}
			}
		} 
		//?
		for(i=0;i<n;i++){
			if(q[i]!=-100){
				money-=200;
			}
		}
		//print
		printf("%d\n",money);
	}
	return 0;
}
int comp( const void *a, const void *b )
{
    return *(const int *)a - *(const int *)b;
}

int main()
{
    int w[1500], t[1500];
    int wsymb[1500], tsymb[1500];
    int n, i, j, tot;

    while( scanf("%d",&n), n )
    {
        for( i = 0; i < n; i++ )
            scanf( "%d", &t[i] );
        for( i = 0; i < n; i++ )
            scanf( "%d", &w[i] );

        qsort( w, n, sizeof(int), comp );
        qsort( t, n, sizeof(int), comp );

        memset( wsymb, 0, n * sizeof(int) );
        memset( tsymb, 0, n * sizeof(int) );
        tot = 0;

        for( i = 0; i < n; i++ )
        {
            for( j = n - 1; j >= 0 && (wsymb[j] || w[j] >= t[i]); j-- );
            if( j < 0 ) continue;
            wsymb[j] = tsymb[i] = 1;
            tot++;
        }

        for( i = j = 0; i < n; i++ )
        {
            if( wsymb[i] ) continue;
            while( j < n && (tsymb[j] || w[i] > t[j]) ) j++;
            if( j == n ) break;
            if( w[i] == t[j] )
                wsymb[i] = tsymb[j++] = 1;
        }
        for( i = 0; i < n; i++ )
            if( !wsymb[i] ) tot--;

        printf( "%d\n", tot * 200 );
    }

    return 0;
}
int main()
{
    int n,i,j,t,x;
    int win,equal;
    int tj[1001];
    int qw[1001];
    for(;;)
    {    
        scanf("%d",&n);
        win=0;
        equal=0;
        if(n==0)
            return(0);
        else
        {
            for(i=1;i<=n;i++)
                scanf("%d",&tj[i]);
            for(i=1;i<=n;i++)
                scanf("%d",&qw[i]);
            for(i=1;i<=n;i++)
                for(j=2;j<=n;j++)
                    if(tj[j-1]<tj[j])
                    {
                        t=tj[j];
                        tj[j]=tj[j-1];
                        tj[j-1]=t;
                    }
            for(i=1;i<=n;i++)
                for(j=2;j<=n;j++)
                    if(qw[j-1]<qw[j])
                    {
                        t=qw[j];
                        qw[j]=qw[j-1];
                        qw[j-1]=t;
                    }
            for(i=n;i>=1;i--)
            {
                for(j=1;j<=n;j++)
                {
                    if(tj[i]>qw[j])
                    {
                        if(tj[i]!=-1 && qw[j]!=-1)
                        {
                            win++;
                            tj[i]=-1;
                            qw[j]=-1;
                            break;
                        }
                    }
                }
            }
            for(i=1;i<=n;i++)
            {
                for(j=1;j<=n;j++)
                {
                    if(tj[i]==qw[j])
                    {
                        if(tj[i]!=-1 && qw[j]!=-1)
                        {
                            equal++;
                            tj[i]=-1;
                            qw[j]=-1;
                            break;
                        }
                    }
                }
            }
            x=(win-(n-win-equal))*200; 
            printf("%d\n",x);
        }
    }
}
/***********************************
*??(4-4) ??3?5?7????
*?? ????
*?? ?2012?10?3?
***********************************/
int main()                              //???
{                                       //?????
  int n , i = 0;                         //??n?i???,?0??i
  // cout << "???????" << endl ;
  cin >> n ;                          //??????
  if(n % 3 == 0 )                     //??n??3?0??n??3??
  {	  cout << "3" ;              //  ??3??i?1
  i = i + 1 ;  }
  if(n % 5 == 0 && i == 1)                      //  ??n??5????i=1
	 { cout << " " << "5" ;              //???????5??i?1
  i = i + 1 ; }
  else  if(i != 1 && n % 5 == 0)   //????i???1????5??
	  {	 cout << "5" ;                    //??5??i?1
	  i = i + 1 ; }
  if(n % 7 == 0 && i != 0)                      //??n??7???i???0
  {	  cout << " " << "7" ;              // ???????7??i?1
  i = i + 1 ; }
  else  if(n % 7 == 0 && i == 0)                                //??????7???i=0
  {	 cout << "7" ;                                       //??7??i?1
  i = i + 1 ;  }
  if(i == 0)                            //??i????0
	 { cout << "n" ; }                  //????n????n???3,5,7??
  cout << endl;                         //??
  return 0;

}                                       //?????
void main()
{
	int i,a,b,c;
	a=3;b=5;c=7;
	scanf("%d",&i);
	if(i%3==0)
	{
		if(i%5==0&&i%7==0)
			printf("%d %d %d",a,b,c);
		else if(i%5==0&&i%7!=0)
			printf("%d %d",a,b);
		else if(i%5!=0&&i%7==0)
			printf("%d %d",a,c);
		else printf("%d",a);
	}
	else if(i%5==0)
	{
		if(i%7==0)
			printf("%d %d",b,c);
		else printf("%d",b);
	}
	else if(i%7==0)
	{
		printf("%d",c);
	}
	else printf("n");
}
int main()
{
	int a;
	scanf("%d",&a);
	if(a%3==0)
	{
		if(a%5==0)
		{
			if(a%7==0)
			printf("3 5 7");
			else printf("3 5");
		}
		else {if(a%7==0)
			printf("3 7");
		else printf("3");}
	}
	else if(a%3!=0)
		{
		if(a%5==0)
		{
			if(a%7==0)
			printf("5 7");
			else printf("5");
		}
		else {if(a%7==0)
			printf("7");
		else printf("n");}
	}
	return 0;
}
int main() 
{
	int n;
    scanf("%d", &n);
	if(n%3==0&&n%5==0&&n%7==0){
        printf("3 5 7"); 
	}
	else {
		if(n%3==0&&n%5==0){
		printf("3 5"); 
		}
	    else {
			if(n%3==0&&n%7==0){
				printf("3 7");
			}
	        else {
				if(n%5==0&&n%7==0){
    				printf("5 7");
				}
				else {
					if(n%5==0){
    					printf("5");
					}
					if(n%3==0){
    					printf("3");
					}
					if(n%7==0){
    					printf("7");
					}
				}
			}
		}		
	}
    if(n%3!=0&&n%5!=0&&n%7!=0){
			printf("n");
	}
    return 0;
}
void main()
{
	int x;
	scanf("%d",&x);
	if(fmod(x,3)==0 && fmod(x,5)==0 && fmod(x,7)==0)
		printf("%d %d %d\n",3,5,7);
    if(fmod(x,3)==0 && fmod(x,5)==0 && fmod(x,7)!=0)
        printf("%d %d\n",3,5);
	if(fmod(x,5)==0 && fmod(x,7)==0 && fmod(x,3)!=0)
		printf("%d %d\n",5,7);
	if(fmod(x,3)==0 && fmod(x,7)==0 && fmod(x,5)!=0)
        printf("%d %d\n",3,7);
	if(fmod(x,3)==0 && fmod(x,5)!=0 && fmod(x,7)!=0)
        printf("%d\n",3);
    if(fmod(x,3)!=0 && fmod(x,5)==0 && fmod(x,7)!=0)
        printf("%d\n",5);
    if(fmod(x,3)!=0 && fmod(x,5)!=0 && fmod(x,7)==0)
		printf("%d\n",7);
	if(fmod(x,3)!=0 && fmod(x,5)!=0 && fmod(x,7)!=0)
		printf("%c\n",'n');
}
int main()
{  int n,a,b,c;//????a?b?c
cin>>n;
a=n%3;//a?n??3???
b=n%5;//b?n??5???
c=n%7;//c?n??7???
if(a==0&&b==0&&c==0)
	cout<<"3"<<" "<<"5"<<" "<<"7";//????3?5?7??
else if(a==0&&b==0&&c!=0)
	cout<<"3"<<" "<<"5";//????3?5??
else if(a==0&&b!=0&&c==0)
	cout<<"3"<<" "<<"7";//????3?7??
else if(a!=0&&b==0&&c==0)
	cout<<"5"<<" "<<"7";//????5?7??
else if(a==0&&b!=0&&c!=0)
	cout<<"3";//?3??
else if(a!=0&&b==0&&c!=0)
	cout<<"5";//?5??
else if(a!=0&&b!=0&&c==0)
	cout<<"7";//?7??
else if(a!=0&&b!=0&&c!=0)
	cout<<"n";//???3?5?7??
return 0;
}
//********************************
//*???5.cpp   **
//*?????3?5?7????   **
//*?????? 1300012838 **
//*???2013.9.26  **
//********************************

int main()
{ 

    int a, num = 0;   //?? ??a?????? ????? 
    cin >> a;
    if (a % 3 == 0)
    {
        cout << "3";   //??3????3 
        num++;   //??????1 
    }
    if (a % 5 == 0)
    {
        if (num != 0)   //???????????? 
        {
            cout << " ";
        }
        cout << "5";   //??5????5
        num++;   //??????1
    }
    if (a % 7 == 0)
    {
        if (num != 0)   //????????????
        {
            cout << " ";
        }
        cout << "7";   //??7????7
        num++;   //??????1
    }
    if (num == 0)   //??????????n 
    {
        cout << "n";
    }
    
    return 0;                    
}
int main()
{
	int n,m; //n?????
	cin>>n;
	m=0;
	if (n%3==0)	
	{
		m=1;
		cout<<3;
		if (n%5==0) cout<<" "<<5;
		else;
		if (n%7==0) cout<<" "<<7;	
		else;
	}
	else
	{
		if (n%5==0) 
		{
			m=1;
			cout<<5;
		if (n%7==0) cout<<" "<<7;	
		else;
		}
		else 
		{
			
			if (n%7==0) 
			{
				cout<<7;
				m=1;
			}
			else;
		}
	}
	if (m==0) cout<<"n";
	else;
	return 0;
}
void main()
{
	int i,m,j;
	scanf("%d",&m);
	if ((m%3!=0)&&(m%5!=0)&&(m%7!=0)) printf("n");
	else for (i=3;i<=7;i=i+2) 
	{
		if (m%i==0) 
		{
			printf("%d",i);
			for (j=i+2;j<=7;j=j+2) 
			{
				if(m%j==0) 
				{
					printf(" ");
					break;
				}
			}
		}
	}
}
void main()
{
	int n;
	scanf("%d",&n);
	if(n%3&&n%5&&n%7)printf("n");
		else if((n%3==0)&&n%5&&n%7)printf("3");
		else if((n%5==0)&&n%3&&n%7)printf("5");
		else if((n%7==0)&&n%5&&n%3)printf("7");
		else if((n%3==0)&&(n%5==0)&&n%7)printf("3 5");
		else if((n%3==0)&&(n%7==0)&&n%5)printf("3 7");
		else if((n%7==0)&&(n%5==0)&&n%3)printf("5 7");
		else if((n%3==0)&&(n%5==0)&&(n%7==0))printf("3 5 7");
}
int main()
{
	int a;
	scanf("%d",&a);
	if((a%3==0)&&(a%5==0)&&(a%7==0))
		printf("%d %d %d",3,5,7);
	else if((a%3==0)&&(a%5==0))
		printf("%d %d",3,5);
	else if((a%3==0)&&(a%7==0))
		printf("%d %d",3,7);
	else if((a%5==0)&&(a%7==0))
		printf("%d %d",5,7);
	else if(a%3==0)
		printf("%d",3);
	else if(a%5==0)
		printf("%d",5);
	else if(a%7==0)
		printf("%d",7);
	else
		printf("n");
}
//C++ program by Ruby;
//to judge whether n could be divided by 3,5,7.
int main()
{
	int n,s;//n for testing number;s for a sumer
	cin>>n;
	s=0;
	if (n%3==0) 
	{
		s=s+1;
		cout<<"3";
	}
	if (n%5==0)
	{
		if (s>=1) cout<<" ";
		s=s+1;
		cout<<"5";
	}
	if (n%7==0)
	{
		if (s>=1) cout<<" ";
		s=s+1;
		cout<<"7";
	}
	if (s==0)  
		cout<<"n"<<endl;
	return 0;
}
int main(){
	int a, b, c, d;
	scanf("%d", &a);
	b=a%3;
	c=a%5;
	d=a%7;
	if (d==0) {
		if (c==0) {
			if (b==0) {
				printf("3 ");
			}
			printf("5 ");
		} else if (b==0) {printf("3 ");}
		printf("7");
	}
	else if (c==0) {
			if (b==0) {
				printf("3 ");
			}
			printf("5");
	}
	else if (b==0) {
				printf("3");
	} else { printf("n");}
	return 0;
}
int main()
{
int x;
scanf("%d",&x);
if(x%105==0)
{
printf("3 5 7");
}
if(x%105!=0)
{
if(x%21==0)
{
printf("3 7");
}
if(x%15==0)
{
printf("3 5");
}
if(x%35==0)
{
printf("5 7");
}
}
if(x%21!=0&&x%15!=0&&x%35!=0)
{
if(x%3==0)
{
printf("3");
}
if(x%5==0)
{
printf("5");
}
if(x%7==0)
{
printf("7");
}
}
if(x%3!=0&&x%5!=0&&x%7!=0)
{
printf("n");
}
return 0;
}
int main(){
	int a,i;
	int b[2][3]={0};
	scanf("%d",&a);
	b[0][0]=3;
	b[0][1]=5;
	b[0][2]=7;
	for(i=0;i<3;i++){
		if(a%b[0][i]==0)
			b[1][i]=1;
		else
			b[1][i]=0;}
	if(b[1][0]==0&&b[1][1]==0&&b[1][2]==0)
		printf("n");
	else{
		if(b[1][0]==1&&b[1][1]==1&&b[1][2]==1)
			printf("3 5 7");
		else{
			if(b[1][0]==0&&b[1][1]==1&&b[1][2]==1)
				printf("5 7");
			else{
				if(b[1][0]==0&&b[1][1]==0&&b[1][2]==1)
					printf("7");
				else{
					if(b[1][0]==1&&b[1][1]==1&&b[1][2]==0)
						printf("3 5");
					else{
						if(b[1][0]==1&&b[1][1]==0&&b[1][2]==0)
							printf("3");
						else{
							if(b[1][0]==1&&b[1][1]==0&&b[1][2]==1)
								printf("3 7");
							else{
								if(b[1][0]==0&&b[1][1]==1&&b[1][2]==0)
									printf("5");}
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int x,a,b,c,A,B,C;
	scanf("%d",&x);
	a=x%3;
	b=x%5;
	c=x%7;
	A=3;
	B=5;
	C=7;
	if(a==0&&b==0&&c==0)
	{printf("3 5 7");}
	if(a==0&&b==0&&c!=0)
	{printf("3 5");}
	if(a==0&&c==0&&b!=0)
	{printf("3 7");}
	if(b==0&&c==0&&a!=0)
	{printf("5 7");}
	if(a==0&&b!=0&&c!=0)
	{printf("3");}
	if(a!=0&&b==0&&c!=0)
	{printf("5");}
	if(a!=0&&b!=0&&c==0)
	{printf("7");}
	if(a!=0&&b!=0&&c!=0)
	{printf("n");}
	return 0;

}
int main()
{
	int num=0;//??????NUM
	cin>>num;
	if(num%105==0)
	{
		cout<<"3 5 7";
	}
	if(num%15==0&&num%7!=0)
	{
		cout<<"3 5";
	}
	if(num%21==0&&num%5!=0)
	{
		cout<<"3 7";
	}
	if(num%35==0&&num%3!=0)
	{
		cout<<"5 7";
	}
	if(num%3==0&&num%5!=0&&num%7!=0)
	{
		cout<<"3";
	}
	if(num%3!=0&&num%5==0&&num%7!=0)
	{
		cout<<"5";
	}
	if(num%3!=0&&num%5!=0&&num%7==0)
	{
		cout<<"7";
	}	
	if(num%3!=0&&num%5!=0&&num%7!=0)
	{
		cout<<"n";
	}
	return 0;
}
//********************************************************************
//??3.5.7????
//??????
//???2012.09.28
//********************************************************************

int main()
{
   int a,b,c,x;
   //cout << "???????" << endl;
   cin >> x;
   if (x % 3 == 0)
	   a = 3;
      else a = 0;
   if (x % 5 == 0)
	   b = 5;
      else b = 0;
   if (x % 7 == 0)
	   c = 7;
      else c = 0;
if (a + b + c == 15)
   cout << "3 5 7";
if (a + b + c == 0)
   cout << "n";
if (a + b + c == 8)
   cout << "3 5";
if (a + b + c == 10)
   cout << "3 7";
if (a + b + c == 12)
   cout << "5 7";
if (a + b + c == 3)
   cout << "3";
if (a + b + c == 5)
   cout << "5";
if (a + b + c == 7)
   cout << "7";
   
return 0;
}
int main() {
int n;
int a = 0, b = 0, c = 0;
cin >> n;
if (n % 3 == 0) { a = 1; cout << 3;}
if (n % 5 == 0) { b = 1; if (a) { cout << " ";} cout << 5;}
if (n % 7 == 0) { c = 1; if (a+b) { cout << " ";} cout << 7;}
if (a + b + c == 0) {cout << "n";}
cout << endl;
return 0;
}
void main()
{
 int n,a[3],i=0;
 scanf("%d",&n);
 if(n%3==0)
 a[i++]=3;
 if(n%5==0)
 a[i++]=5;
 if(n%7==0)
 a[i++]=7;
 switch(i)
{
 case 3:printf("%d %d %d",a[0],a[1],a[2]);break;
 case 2:printf("%d %d",a[0],a[1]);break;
 case 1:printf("%d",a[0]);break;
 case 0:printf("%c",'n');break;
}
}
int main()
{
    int a;
	scanf("%d",&a);
	if (a%3==0 && a%5==0 && a%7==0){
		printf("3 5 7\n");
	}
	else if(a%3==0 && a%5==0 && a%7==1 | a%7==2 | a%7==3  | a%7==4 | a%7==5 | a%7==6){
		printf("3 5\n");
	}
	else if(a%3==0 && a%5==1 | a%5==2 | a%5==3 | a%5==4 && a%7==0){
		printf("3 7\n");
	}
	else if (a%3==1 | a%3==2 && a%5==0 && a%7==0){
		printf("5 7\n");
	}
	else if (a%3==1 | a%3==2 && a%5==1 | a%5==2 | a%5==3 | a%5==4 && a%7==0){
		printf("7\n");
	}
	else if(a%3==1 | a%3==2 && a%5==0 && a%7==1 | a%7==2 | a%7==3  | a%7==4 | a%7==5 | a%7==6){
		printf("5\n");
	}
	else if(a%3==0 && a%5==1 | a%5==2 | a%5==3 | a%5==4 && a%7==1 | a%7==2 | a%7==3  | a%7==4 | a%7==5 | a%7==6){
		printf("3\n");
	}
	else{
		printf("n\n");
	}

	return 0;
}
int main()
{
	int i;
	scanf("%d",&i);
	if(i%3==0) 
	{printf("3");
	if(i%5==0)
		printf(" 5");
	if(i%7==0)
    	printf(" 7");
	}
    else if(i%5==0) 
	{
		printf("5");
	    if(i%7==0)
		printf(" 7");
	}
	else if(i%7==0)
	{
	printf("7");
	}
	else
	{printf("n");
	}
	return 0;
}
int main (){
  int n ;
  scanf("%d",&n);
  if(n%105==0){printf("3 5 7");}
  else if(n%15==0){printf("3 5");}
  else if(n%21==0){printf("3 7");}
  else if(n%35==0){printf("5 7");}
  else if(n%3==0&&n%35!=0){printf("3");}
   else if(n%5==0&&n%21!=0){printf("5");}
    else if(n%7==0&&n%15!=0){printf("7");}
	else if(n%105!=0){printf("n");}
	return 0;

}
//*******************************
//*?????3?5?7????   **
//*????? 1300012707 **
//*???2013.10.1  **
//********************************
int main()
{
	int n, s; // ????n?????switch????
	cin >> n; // ??????n
	s = 0; // ???s
	if ( n % 3 == 0 ) // ??n??3??
    {
		s = s + 3; // s??3
    }
	if ( n % 5 == 0 ) // ??n??5??
    {
		s = s + 5; // s??5
    }
    if ( n % 7 == 0 ) // ??n??7??
    {
		s = s + 7; // s??7
    }
    switch (s) // ?switch??
	{
        case 15:
            cout << "3 5 7" << endl; // ??s??15???n??3?5?7?????3 5 7
            break;
        case 12:
            cout << "5 7" << endl; // ??s??12???n??5?7?????5 7
            break;
        case 10:
            cout << "3 7" << endl; // ??s??10???n??3?7?????3 7
            break;
        case 8:
            cout << "3 5" << endl; // ??s??8???n??3?5?????3 5
            break;
        case 7:
            cout << "7" << endl; // ??s??7???n??7?????7
            break;
        case 5:
            cout << "5" << endl; // ??s??5???n??5?????5
            break;
        case 3: 
            cout << "3" << endl; // ??s??3???n??3?????3
            break;
        default:
            cout << "n" << endl; // ??s??0???n??3?5?7?????n
            break;
    }
	return 0;
}
void main()
{
 int a,b,c,d;
scanf("%d",&d);
 a=3;
 b=5;
 c=7;
if(d%3==0&&d%5==0&&d%7==0) printf("%d %d %d",a,b,c);
else if(d%3!=0&&d%5!=0&&d%7!=0) printf("n");
else if(d%3==0&&d%5!=0&&d%7!=0) 
	 printf("%d",a);
else if (d%3!=0&&d%5==0&&d%7!=0)
	 printf("%d",b);
else if (d%3!=0&&d%5!=0&&d%7==0)
	 printf("%d",c);
else if(d%3==0&&d%5==0&&d%7!=0)
	 printf("%d %d",a,b);
else if(d%3==0&&d%5!=0&&d%7==0)
	 printf("%d %d",a,c);
else if(d%3!=0&&d%5==0&&d%7==0)
	 printf("%d %d",b,c);
}
int main()
{   
	int a;
	scanf("%d",&a);
    if(a%3==0){
		printf("3");
	    for (int i=5;i<8;i+=2){
		if(a%i==0){
			printf(" %d",i);
		}
		}
	}else {
		if(a%5==0 && a%7==0){
			printf("5 7");
		}else if(a%5==0 && a%7!=0){
			printf("5");
		}else if(a%5!=0 && a%7==0){
			printf("7");
		}else{
			printf("n");
		}
	}
	return 0;
}
void main()
{
  int k;
  scanf("%d",&k);
  int i;
  int a=0,b=0,c=0;
  
  if(k%3==0)
  {printf("3");if(k%5==0)printf(" 5");if(k%7==0)printf(" 7");}
  else if(k%5==0)
  {printf("5");if(k%7==0)printf(" 7");}
  else if(k%7==0)printf("7");else printf("n");
  

  
  
}
int main(int argc, char* argv[])
{
	int a,m;
	m=0;
	
	scanf("%d",&a);
	
	
   if(a%3==0)
   
   m=m+1;
   if(a%5==0)
  
   m=m+10;
   if(a%7==0)
   
   m=m+100;
   if(m==0)
	printf("n");
   if(m==1)
   printf("3");
   if(m==10)
	   printf("5");
   if(m==100)
   printf("7");
   if(m==11)
   printf("3 5");
   if(m==101)
   printf("3 7");
   if(m==110)
   printf("5 7");
   if(m==111)
	   printf("3 5 7");

   return 0;
}
int main()
{
int n;   //???????
int d3=0,d5=0,d7=0,d=0;  //???????? 
cin>>n;
if (n%3==0) {d3=1;d=d+1;} //??d?????????? 
if (n%5==0) {d5=1;d=d+2;}
if (n%7==0) {d7=1;d=d+4;}
if (d==0) cout<<"n";      //??????? 
if (d==1) cout<<"3";
if (d==2) cout<<"5";
if (d==4) cout<<"7";
if (d==3) cout<<"3 5";
if (d==5) cout<<"3 7";
if (d==6) cout<<"5 7";
if (d==7) cout<<"3 5 7";
return 0;
}
int main()
{
	int n;
	scanf("%d",&n);
	if(n%3==0){
		if(n%5==0){
			if(n%7==0){
				printf("3 5 7");
			}
			if(n%7!=0){
				printf("3 5");
			}
		}
		if(n%5!=0){
			if(n%7==0){
				printf("3 7");
			}
			if(n%7!=0){
				printf("3");
			}
		}
	}
	if(n%3!=0){
		if(n%5==0){
			if(n%7==0){
				printf("5 7");
			}
			if(n%7!=0){
				printf("5");
			}
		}
		if(n%5!=0){
			if(n%7==0){
				printf("7");
			}
			if(n%7!=0){
				printf("n");
			}
		}
	}
	return 0;
}
int main()
{
    int c;
    int a;
    scanf("%d",&a);
    if(a%105==0)
    {
                printf("3 5 7");
    }
    else if((a%15==0)&&(a%7!=0)) 
    {
                            printf("3 5");
    }
    else if((a%21==0)&&(a%5!=0))
    {
         printf("3 7");
    }
    else if((a%35==0)&&(a%3!=0))
    {
         printf("5 7");
    }
    else if((a%3==0)&&(a%35!=0))
    {
         printf("3");
    }
    else if((a%5==0)&&(a%21!=0))
    {
         printf("5");
    }
    else if((a%7==0)&&(a%15!=0))
    {
         printf("7");
    }
    else
    {
        printf("n");
    }
    while((c=getchar())!='\n'&&c!=EOF);
    clearerr(stdin);
    getchar();
    return 0; 
}
int main()
{
    int a,b,c,d;
    scanf("%d",&a);
    char n;
    if(a%3==0&&a%5==0&&a%7==0)
    printf("3 5 7");
    if(a%3!=0&&a%5!=0&&a%7!=0)
    printf("n");
    if(a%3!=0&&a%5==0&&a%7==0)
    printf("5 7");
    if(a%3==0&&a%5==0&&a%7!=0)
    printf("3 5");
    if(a%3==0&&a%5!=0&&a%7==0)
    printf("3 7");
    if(a%3==0&&a%5!=0&&a%7!=0)
    printf("3");
    if(a%3!=0&&a%5==0&&a%7!=0)
    printf("5");
    if(a%3!=0&&a%5!=0&&a%7==0)
    printf("7");
    return 0;
}
//********************************
//*?????3?5?7????   **
//*?????? 1200012988 **
//*???2012.09.30  **
//********************************

int main()                                     //???
{
    int n;                                     //?n??
    cin >> n;                                  //??n
    //??n?????3?5?7??
    if(n % 3 == 0 && n % 5 == 0 && n % 7 == 0)
    cout << "3 5 7" << endl;                   //??3 5 7
    else                                       //????
    {
        if(n % 3 == 0 && n % 5 == 0)           //??????3?5??
        cout << "3 5" << endl;                 //??3 5
        else
        {
            if(n % 5 == 0 && n % 7 == 0)       //??????5?7??
            cout << "5 7" << endl;             //??5 7
            else
            {
                if(n % 3 == 0 && n % 7 == 0)   //??????3?7??
                cout << "3 7" << endl;         //??3 7
                else                           //????????????
                {
                    if(n % 3 == 0)             //????3??
                    cout << "3" << endl;       //??3
                    if(n % 5 == 0)             //????5??
                    cout << "5" << endl;       //??5
                    if(n % 7 == 0)             //????7??
                    cout << "7" << endl;       //??7
                    //??n???3?5?7??
                    if(n % 3 != 0 && n % 5 != 0 && n % 7 != 0)
                    cout << "n" << endl;         //??????n
                }
            }
        }

    }
    return 0;                                  //??????
}
int main()
{
	int n,i;
	scanf("%d",&n);
	if(n%3==0&&n%5==0&&n%7==0)
	{
		printf("3 5 7");
	}
	else if(n%3==0&&n%5==0)
	{
		printf("3 5");
	}
	else if(n%3==0&&n%7==0)
	{
		printf("3 7");
	}	
	else if(n%5==0&&n%7==0)
	{
		printf("5 7");
	}
	else {
		for(i=3;i<8;i=i+2)
		{
		if(n%i==0)
	{
		printf("%d",i);
	}
		}
	}
	if(n%3!=0&&n%5!=0&&n%7!=0)
	{
		printf("n");
	}
     return 0;
}