semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	int n, m, a[20000], i, j, k;
	scanf("%d",&n);
	if(n>=1 && n<=20000)
	{
		scanf("%d",&a[0]);
		for(i=1; i<n; i++)
			scanf(" %d",&a[i]);//??n???
		for(i=0, m=0; i<n-m-1; i++)
		{
			for(j=i+1; j<n-m; j++)
			{
				if(a[i]!=a[j])
					continue;
				else
				{
					for(k=j; k<n-m-1; k++)//?????????????????????
						a[k]=a[k+1];
					m++;
					j--;
				}
			}
		}
		printf("%d",a[0]);
		for(i=1; i<n-m; i++)
			printf(" %d",a[i]);
	}
}
int main()
{
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
		cin>>a[i];
	cout<<a[0];
	for(int i=1;i<n;i++)
		for(int j=0;j<i;j++)
		{
			if(a[i]==a[j])
				a[i]=1;
		}
	for(int i=1;i<n;i++)
	{
		if(a[i]>1)
			cout<<" "<<a[i];
	}
	return 0;


}
int main()
{
int a[20000];
int n,i,j,s,k;
scanf("%d",&n);
for(i=0;i<n;i++)
  {
   scanf("%d",&a[i]);
  }
for(i=0;i<n;i++)
  {
     s=a[i];
     for(k=i+1;k<n;k++)
     {
       if(a[k]==s)
       {       
        for(j=k;j<n;j++)
        {
         a[j]=a[j+1];
        }
        n--;
        k--;        
       }
     }
   }
for(i=0;i<n;i++)
  {
   if(i>0)
   printf(" ");
   printf("%d",a[i]);
  }
return 0;
}
int main()
{
int n;int a[100000],b[100000]={0};
int i,j;
scanf("%d\n",&n);
for(i=0;i<n;i++){
	scanf("%d",&a[i]);
}
		
	for(i=0;i<n;i++){
	 for(j=0;j<n;j++){
	if(b[i]==0){
	
	if(i!=j){
	
	
	if(a[i]==a[j]){
		b[j]=1;}
	}
	else
	continue;
	}}}
	printf("%d",a[0]);
	for(i=1;i<n;i++)
	{
		if(b[i]==0)
		{
		printf(" ");printf("%d",a[i]);}
		else
		continue;	
}
return 0;
}
int main()
{
	int n,i,a[20000];
	cin>>n;
	cin>>a[0];
	for(i=1;i<n;i++)
	{
		cin>>a[i];
		for(int j=0;j<i;j++)
		{
			if(a[i]==a[j])
			{
				i-=1;
				n-=1;
				break;
			}
		}
	}
	for(i=0;i<n;i++)
	{
		if(i>0)
			cout<<" ";
		cout<<a[i];
	}
	return 0;
}
int main()
{
	int n, i, j, a[20005], b[20005] ={0};
	cin >> n;
	for(i = 0; i < n; i++)
		cin >> a[i];
	for(i = 0; i < n; i++)
	{
		for(j = 0; b[j] != 0; j++)
		{
			if(b[j] == a[i])
				break;
		}
		if(b[j] == 0)
			b[j] = a[i];
	}
	cout << b[0];
	for(i = 1; b[i] != 0; i++)
	{
		cout << " " << b[i];
	}

	return 0;
}
/*???????
???10/31*/
int main()
{
	int a[20000],i,j,k,n,count = 0;
	cin >> n;											//??????????
	for(i = 0; i < n; i++)                               
	{
		cin >> a[i];                                     //??????
	}
	for(i = 1, k = 1; i < n; i++)
	{
		for(j = 0; j < i; j++)
		{
			if(a[j]==a[i])break;
		}
		if(j == i)
		{
			a[k] = a[i];
			k++;
            count++;                                    //????????
		}
			
	}
	cout << a[0];	
	for(k = 1; k <= count; k++)
		cout << " " << a[k];
	return 0;
}
main()
{
     int n,m,k,i,j,l;
     int s[12000];
     scanf("%d",&n);
     m=n;l=0;
     for (i=1;i<=n;i++)
     { 
         l++;
     scanf("%d",&s[l]);
                 for (j=1;j<=l-1;j++) 
                 if (s[j]==s[l])
                 {
                 l--;m--;
                 }
                 }
        for (i=1;i<=m-1;i++)
        printf("%d ",s[i]);
        printf("%d",s[m]); 

}
int god(int num1,int num2);
int main(void)
{
	int number,ctr,i;
	int n[20000],c[20000];
	scanf("%d",&number);
	for(i=0;i<=20000;i++)
	{
		c[i]=0;
	}
    for(ctr=0;ctr<number;ctr++)
	{
		scanf("%d",&n[ctr]);
	}
	printf("%d",n[0]);
	for(ctr=1;ctr<number;ctr++)
	{
		for(i=0;i<ctr;i++)
		{
			if(n[i]==n[ctr])
			{
				c[ctr]++;
			}
		}
		if(c[ctr]==0)
			printf(" %d",n[ctr]);
	}
				
	getchar();
	return 0;
}
int main()
{
    int n,b[101]={0},i;
    
    cin>>n;
    int a[20001]={0};
    
    for(i=1;i<=n;i++)
    {
                     cin>>a[i];
                     b[a[i]]=b[a[i]]+1;
    }
    cout<<a[1];
    b[a[1]]=0;
    for(i=2;i<=n;i++)
    {
                     if(b[a[i]]!=0)
                     cout<<" "<<a[i];
                     b[a[i]]=0;
    }
    return 0;
}
void main()
{ 
	int n,i=0,k=0,t=0;
	int a[90000]={0};
	
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);

	printf("%d",a[0]);

	for(k=1;k<n;k++)

	{	t=0;
		for(i=0;i<k;i++)
	{
			if(a[k]==a[i])
				t=1;
			
				}
	if(t==0)
	printf(" %d",a[k]);
	
	}
}
main()
{
      int n,a[20000],b[20000],i,j;
      scanf("%d",&n);
      for(i=0;i<n;i++)
        scanf("%d",&a[i]);
      for(i=0;i<n;i++)
        b[i]=0;
      printf("%d",a[0]);
      for(i=1;i<n;i++)
        for(j=0;j<i;j++)
          if(a[i]==a[j])
          {
             b[i]++;
             break;
          }   
      for(i=1;i<n;i++)
        if(b[i]==0)
          printf(" %d",a[i]);
      getchar();
      getchar();
      getchar();
      getchar();
}
int main()
{
    int n,j,k,m=1,x,a[1000];
    scanf("%d",&n);
    if(n==0) return(0);
	else
	{
    scanf("%d",&x);
    printf("%d",x); 
    a[0]=x; 
	for(j=1;j<n;j++)
	{
		scanf("%d",&x);
		k=0;
		while((k<m) && (a[k]!=x))
			k++;
		if(k==m) 
		{a[m++]=x;
		printf(" %d",x);
		}
	}
	printf("\n");
	}
}
int main()
{
  int n,i,k,sum=0;
  scanf("%d",&n);
  int x[n];
  for(i=0;i<n;i++){
      scanf("%d",&x[i]);
      for(k=0;k<i;k++){
          if(x[k]==x[i]){
             i--;
             n--;
             break;
             }
          }
  }
  printf("%d",x[0]);
  for(i=1;i<n;i++){
      printf(" %d",x[i]);
  }    
  return 0;
}
int main()
{
 int n,a[101],number,i;   //n????a?????????????number????
                          //????????i
 cin>>n;
 for(i=1;i<=100;i++)
  a[i]=0;                 //???a????0
 cin>>number;
 cout<<number;
 a[number]=1;
 for(i=1;i<=n-1;i++)
  {
   cin>>number;           //?????
   if(a[number]==0)       //?a[number]?0????????
    {
     a[number]=1;         //?a[number]??1??????
     cout<<" "<<number;   //????????
    }
   }
 return 0;
}
int main(){
	int n;
	int i;
	int d;
    int flag[101];
    for (i = 0;i <= 100; i++)
    {
        flag[i] = 0;
    } 
    cin>>n;
    int couted = 0;
	for( i = 0; i < n ; i ++)
	{
		cin>>d;
		if(flag[d] == 0)
		{
			if(couted == 0)
			{
				cout<<d;
				couted = 1;
			}
			else
			{
				cout<<" "<<d;
			}
			flag[d] = 1;
		}
	}
	
 
return 0;
}
//?????
int main()
{
	int n,x;         //n?????
	int a[100];
	cin>>n;
	for(int k=0;k<100;k++)
		a[k]=0;
	for(int i=0;i<n;i++)
	{
		cin>>x;     //???????x
		for(int j=10;j<100;j++)
		{
			
			if(x==j) a[j]=a[j]+1;   
		}
		if(a[x]==1)
		{
			if(i!=0)
				cout<<" "<<x; //??????????????????x
			else
				cout <<x;
		}
	}
	return 0;
}
void main( )
{
	int n,i,j,k,sum=0;
	int a[20000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
    for(i=0;i<n-sum;i++)
	for(j=i+1;j<n-sum;j++)
	{
		if(a[j]==a[i])
		{
			for(k=j;k<n-sum-1;k++)
			a[k]=a[k+1];
			sum++;
			j--;
		}
	}
for(i=0;i<n-sum-1;i++)
{
	printf("%d ",a[i]);
}
printf("%d",a[n-sum-1]);
}
/**
 *  ????buchongfushu.cpp
 *  ?????????
 *  ??????
 *  ???2010.10.30
 */


int main()
{
	int n , i , j , number;
	int a[100] = {0};               //??????????????

	cin >> n;
	i = 0;
	for (j = 1 ; j <= n ; j++)
	{
		cin >> number;
		if (a[number] == 0)         //????????????           
		{
			a[number]++;
			if (i == 0)             //????????????
			{
				cout << number;
				i = 1;
			}
			else
			{
				cout << " " << number;
			}
		}
	}
	return 0;
}
int main()
{
	int n,i,j,a[20000],m;
    scanf("%d",&n);
	if(n>=1&&n<=20000)
	{	
		
		for(i=0;i<n;i++)
		{
			m=0;
			if(i==0)
			{
				scanf("%d",&a[0]);
				printf("%d",a[0]);
			}	
			else 
			{
				scanf(" %d",&a[i]);
				for(j=0;j<i;j++)                  
				{
					if(a[i]==a[j])
					{
						m++;
					}
				}
				if(m==0)
				{
				printf(" %d",a[i]);
				}
			}
		}
	}
	return 0;
}
//*****************************
//????????????.cpp*
//?  ?????              *
//?  ??2010?10?22?      *
//*****************************
int main()
{
	int n,i,num[20000];                 //??????n?????
	cin>>n;                             //?????????n
	for(i=0;i<n;i++)
	{
		cin>>num[i];               //??????
		if (i>0)
		{
			for (int k=0;k<i;k++)
			{
				if(num[i]==num[k])
					num[i]=0;
			}                 //?????????????????????0
		}
	}
	cout<<num[0];                       //??????
	for(i=1;i<n;i++)
	{
		if(num[i]>9)
			cout<<" "<<num[i];
	}                                   //???????????0?????????????
	return 0;
}
/*
 * ??? ??2011-10-21 output the numbers with no repetition.cpp
 * ??           ???
 * ????: 2011-10-21
 * ???? ? ??n????n???????????????10-100???
                                   ??????????????????????????????????????????
 */

int main()
{
	int n,i=0,j=0,k=0,step=0;             //?????? n,i,j,k,step=0,?????step?????????
	cin>>n;
	int a[n];                             //????a[n]
	for(i=0;i<n;i++)                      //?????????????????????????0?n-1
	cin >>a[i];
	for(i=0;i<n-1-step;i++){
		for(j=i+1;j<n-step;j++){
			if(a[i]==a[j]){               //???????????????????????????????????????.??????????????????????????????
				if(j==n-1-step){          //???j??????????????????????????
					step++;
				continue;
				}
				for(k=j;k<n-1-step;k++)    //???j?????????????????j??????????
					a[k]=a[k+1];
			  step++;                     //???????????????
			  j--;                        //??????????????????i????????????????????i--??????????i+1????
			}
		}
	}
	for(i=0;i<n-step-1;i++)               //??????????-1???n-2-step????????????? 
		cout<<a[i]<<' ';                  //
	    cout<<a[n-1-step]<<endl;          //????????????n-1-step?
	return 0;
}
// 
//	?????	????????
//	?????	??n???????????????????????????????????????????????
//	?????	?  ? ? ? ? ? 1000012733 ?
//	?????	2010 ? 10 ? 31 ?
//
int main()
{
	int n, num, i, j = 0, k;	//?????????????
	int a [ 91 ] = { 0 };	//????a[91]?????????num?????????num????10-100?????????????91??????
	cin >> n;		//??????????
	int b [ 20000 ] = { 0 };	//????b[20000]??????????????????????????
	for ( i = 0; i < n; i ++ )	//?????????????n????????n???
	{
		cin >> num;	//??????num
		if ( a [ num - 10 ] == 0 )	//?????????a??????0???????????
		{
			b [ j ] = num;	//???b?????????????????????num?????
            a [ num - 10 ] ++;	//??a?????????1
			j ++;	//??b????????num?j?????1???????????????num????b?????
		}
	}
	cout << b [ 0 ];	//??b ???????????
	for ( k = 1; k <= n; k ++ )
	{
		if ( b [ k ] == 0 ) break;	//??????b ????????????????????????????????????
		else cout << " " << b [ k ];	//????????????????????????b[k]
	}
	return 0;
}
int main()
{
	int i,j,n,flag;
	int a[100000];
	scanf("%d\n",&n);
	scanf("%d",&a[0]);
	for(i=1;i<n;i++)
	{
		scanf(" %d",&a[i]);
	}
	printf("%d",a[0]);
	for(i=1;i<n;i++)
	{
		flag=0;
		for(j=0;j<i;j++)
		{
			if(a[j]==a[i])
				flag=1;
		}
		if(flag==0)
		printf(" %d",a[i]);
	}
	return 0;
}
int main()
{
	int a[91];
	int i,n,number;
	cin >> n;
	memset(a,0,sizeof(a));
	cin >> number;
	a[number - 10]++;
		if ( a[number - 10] == 1)
			cout << number ;
	for (i = 1; i < n; i++)
	{
		cin >> number;
		a[number - 10]++;
		if ( a[number - 10] == 1)
			cout << " " << number ;
	}
	cout << endl;
return 0;
}
int  main()
{
	int n,i,j,m=0;
	int a[20000];
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	for(i=0;i<n;i++){
		int t=0;
		for(j=0;j<i;j++)
			if(a[i]==a[j]) {
			t++; break;
			}

	if(t==0){
		if(m>0) cout<<" ";
		cout<<a[i];
	m++;
	}
	}
	return 0;
}
int main()
{int n,i,j,s=0;
int a[20000];
scanf("%d",&n);
for(i=1;i<=n;i=i+1)
{scanf("%d",&a[i-1]);}
for(i=1;i<=n;i=i+1)
{s=0;
if(i==1) printf("%d",a[i-1]);
else
{for(j=0;j<i-1;j=j+1)
{s=(a[i-1]==a[j]) ? s+1 : s;}
if(s==0) printf(" %d",a[i-1]);}}
return 0;
}
int main()
{
	int n,num[20000],i,j;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&num[i-1]);
		for(j=1;j<=i-1;j++)
			if(num[j-1]==num[i-1])
			{
				num[i-1]=0;
				break;
			}
	}
	printf("%d",num[0]);
	for(i=1;i<=n-1;i++)
	{
		if(num[i]!=0) printf(" %d",num[i]);
	}
	return 0;
}
/*
??? 
1000012905  
*/
int main()
{
	int	n, i, j, k, g, p = 0;
	
	//?? 
	cin >> n;
	int 	a[n + 1];
	memset(a, 0, sizeof(a));
	for (i = 1; i <= n; i ++)
	{
		cin >> a[i];
	}
	
	//??????? 
	for (j = 1; j <= n; j ++)
	{
		g = 0;
		
		//????????? 
		for (k = 1; k <= j-1; k ++)
		{
			if (a[j] == a[k])
			{
				g = 1;
			}
		}
		
		//????????????? 
		if (g == 0)
		{
			if (p != 0)
			{
				cout << " ";
			}
			cout << a[j];
			p ++;		//???????? 
		}
	}
	return 0;
}
int main()
{
	int n,i,a[101];
	int b;
	scanf("%d",&n);
	for(i=0;i<n;i++){
	{
		scanf("%d",&b);
	}if(a[b]==1){
		a[b]=1;}
	else
	{ if(i!=0){
		printf(" ");}
	printf("%d",b);
	a[b]=1;
	}
	}
	return 0;
}
int main()
{
	int i,n,m,j;
	int a[20000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<i;j++)
		{
			if(a[j]==a[i])
			{
				a[i]=0;
			}
		}
	}
	for(i=0;i<n;i++)
	{
		if(a[i]!=0)
		{
			m=i;		   
		}
	}
	for(i=0;i<m;i++)
	{
		if(a[i]!=0)
		{
			printf("%d ",a[i]);
		}
	}
	printf("%d",a[m]);
		return 0;
}
/*
 * shuzuwenti3.cpp
 *??
 *  Created on: 2013-10-20
 *      Author: Administrator
 */
int main()
{
	int n,a[20001],i,j,b=0;
	cin>>n;
	for(i=1;i<=n;i++)
		cin>>a[i];
	cout<<a[1];//??????
	for(i=2;i<=n;i++)
	{
		for(b=0,j=1;j<i;j++)
		{
			if(a[i]!=a[j])//??????
				b=b+1;//????????
		}
		if(b==i-1)
			cout<<" "<<a[i];//????
	}
	return 0;
}
/*
??n????n???????????????10-100???
???????????????????????????????????????????
????
???????
??????????n?1<=n<=20000??????????????????
???????????n????????????10???100?
????
???????????????????????????????????????
????
5

10 12 93 12 75
????
10 12 93 75
*/
//*******************************
//*???????????        * 
//*??????                  * 
//*?????2010-10-22          * 
//*******************************
int main()//????? 
{
    int num[20000];//???????? 
    int i,j,k,h;//?????????? 
    int check[20000];//??????????? 
    int n;//????????? 
    cin>>n;
    check[0]=0;//????????????????check???0 
    for(i=0;i<n;i++)//???? 
    {
        cin>>num[i];
    }
    for(j=1;j<n;j++)//??????? 
    {
           check[j]=0;
           for(k=0;k<j;k++)
           {
                 if(num[j]==num[k])//?????????????check?1 
                 {                 
                    check[j]=1;
                    break;//???? 
                 }                         
           }
           
    }
    cout<<num[0];
    for(h=1;h<n;h++)//????check?0???????????? 
    {
           if(check[h]==0)
           cout<<" "<<num[h]; 
    }
    return 0;
}
int main()
{
     int N,m,i,j,a[10000],t,b[10000]={0},n[10000]={0},k,p=0,x=0,q;
     
	 
    
         
		 scanf("%d",&m);
         for(j=0;j<m;j++)
             scanf("%d",&a[j]);
         b[0]=a[0];
         for(j=0;j<m;j++)
		{
		  p=0;
		  for(k=0;b[k]!=0;k++)
             {
			    if(a[j]==b[k])  {n[k]++;p=1;break;}
			 
			 }
           if(p==0)  {b[k]=a[j]; n[k]++;}    
        }
	   for(k=0;b[k]!=0;k++)
	   {
	      x++;
		  if(x==1) printf("%d",b[k]);
		  else printf(" %d",b[k]); 
	   
	   } 
      

 
   return 0;
}
int main()
{
	int k=0,i,j,n,a[20000];
	scanf("%d",&n);
	for(i=0;i<n;i++) scanf("%d",&a[i]);		
		for(i=0;i<n;i++)//????
	{
		for(j=i+1;j<n;j++)
		{
			if(a[j]==a[i]) //????????????????0?????
			a[j]=0;
		}
	}
	for(j=n-1;a[j]==0;j--) k=0;//????????????,?????????0?????
	for(i=0;i<j;i++)
	if(a[i]!=0)
    printf("%d ",a[i]);
	printf("%d",a[j]);
    return 0;
}
int hs(int a);
int main(){
	int n,b[20002],i,j,pd,js;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&b[i]);
	}
	js=n;
	for(i=1;i<=n;i++){
		for(j=1;j<i;j++){
			if(b[j]==b[i]){
				js--;
				break;
			}
		}
    }
    pd=1;
	for(i=1;i<=n;i++){
		for(j=1;j<i;j++){
			if(b[j]==b[i]){
				pd=0;
			}
		}
		if(pd==1&&js!=1){
			printf("%d ",b[i]);
			js--;
		}
		else if(pd==1&&js==1){
			printf("%d",b[i]);
			break;
		}
		pd=1;
	}
	scanf("%d",&n);
	return 0;
}
int main(){
	int n,input[20000],output[20000],i,j,k,x;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&input[i]);
	}
	k=0;
	for(i=0;i<n;i++){
		x=0;
		for(j=0;j<i;j++){
			if(input[i]==input[j]){
				x++;
                                    break;
                  }
		}
		if(x==0){
			k++;
			output[k]=input[i];
		}
	}
	for(i=1;i<k;i++){
		printf("%d ",output[i]);
	}
	if(i==k)
		printf("%d\n",output[i]);
return 0; 
}
/*
 * 1.cpp
 *
 *  Created on: 2011-11-4
 *      Author: 11288
 */
int main(){
	int n,i,j,k;
	cin>>n;
	int a[n],b[n];
	for(i=0;i<n;i++)
		cin>>a[i];
	for(i=0;i<n;i++)
		b[i]=a[i];
	for(i=0;i<n;i++)
		for(j=i+1;j<n;j++)
			if(a[i]==b[j])
				b[j]=0;
	cout<<b[0];
	for(i=1;i<n;i++)
		if(b[i]!=0)
			cout<<' '<<b[i];
	return 0;

}
int main ()
{
    int n,k;
    scanf("%d",&n);
    int a[n];
    scanf("%d",&a[0]);
    printf("%d",a[0]);
    for (int i=1;i<n;i++)
    {
        scanf("%d",&a[i]);
        k=1;
        for (int j=0;j<i;j++)
        {    if (a[i]==a[j])
            k=0;}
        if(k!=0) printf(" %d",a[i]);
           
        }
    }
int main()
{
	int a[20000],b[20000]={0};
	int i,j,k,m=0,n;
	scanf("%d",&n);
	for (i=0;i<n;i++)
		scanf("%d",&a[i]);
	for (i=0,j=0;i<n;i++,m=0)
	{
		for (k=j;k>=0;k--)
		{
			if (a[i]==b[k])
			{
				m=1;
				break;
			}
		}
		if (m==0)
		{
			b[j]=a[i];
			j++;
		}
	}
	for (i=0;i<j-1;i++)
		printf("%d ",b[i]);
	printf("%d",b[j-1]);
	return 0;
}
int main()
{
	int n;
	scanf("%d",&n);
	int a[n],i;
	for(i=1;i<=n;i++)
	{
		scanf("%d",&a[i-1]);
	}
	printf("%d",a[0]);
	for(i=2;i<=n;i++)
	{
		int j=1;
		while(j<i)
		{
			if(a[i-1]==a[j-1])
			{
				break;
			}
			else
			{
				j++;
			}
		}
		if(j==i)
		{
			printf(" %d",a[i-1]);
		}
	}
	return 0;
}
int main()
{
    int a[20000],n,i,num,j,flag,k,h=0;
    scanf("%d%d",&n,&a[0]);
    for(i=1;i<=n-1;i++)
    {scanf("%d",&num);
        for(j=0;j<=i-1;j++)
        {if(num!=a[j])
            flag=1;
         else
         {flag=0;break;}}
     if(flag==1)
     {h++;
         a[h]=num;}
    }
    for(k=0;k<=h-1;k++)
        printf("%d ",a[k]);
    printf("%d",a[h]);
    return 0;
}
void main()
{   int m,t,i,j,n;
    int a[20000],b[20000];
	a[20000]='\0';
	b[20000]='\0';
	scanf("%d",&n);
    /*??????*/
	for(i=0;i<n;i=i+1)
		scanf("%d",&b[i]);
	/*????????????????????*/
	a[0]=b[0];
	m=1;
	t=1;
	for(i=1;i<n;i=i+1)     
	{for(j=0;j<m;j=j+1)
	   {if(a[j]==b[i])t=0;}  /*???for?????b[i]?a?????????????????????t???0*/
	if(t==1){a[m]=b[i];/*??t=1???b[i]?a???????????????b[i]??a,????m?m????a????????*/
	m=m+1;}              /*?????????	if(t==1){a[m]=b[i];
	                                    m=m+1;
	                                   t=1;   }           ?t=1?????i??????????
	                                                           t??1?????t?1??0?????????????
	                                                                      ?t=1?t=1,t=0????????*/
	t=1;}/*?????b[i]??t???????????????????????b[i]*/
    /*?????*/
	for(i=0;i<m-1;i=i+1)
		printf("%d ",a[i]);
printf("%d",a[m-1]);
}
/*
 * ????????????.cpp
 * ??????
 * ?????2012.11.8
 * ???????????
 */
int main()
{
	int n,i,j,k,p;
	cin>>n;//?????????
	int a[20001];//????
	for (i=0;i<n;i++){
		cin>>a[i];}//?????
	for (j=0;j<n;j++){
		for (k=j+1;k<n;k++){
			if (a[k]!=0){//????????0??????
			if (a[j]==a[k]){
				a[k]=0;//??????????????0
			}}
		}
	}
	cout<<a[0];
	for (p=1;p<n;p++){
		if (a[p]!=0)
			cout<<" "<<a[p];//??????
		continue;
	}
	cout<<endl;
	return 0;
}
int main()
{
	int n,m,i,j,a[20000],p=1;
	scanf("%d",&n);
	scanf("%d",&a[0]);
	for (i=1;i<n;i++)
	{
		scanf("%d",&m);
		for (j=0;j<i;j++)
		{
			if (m==a[j])
			{
				p=0;
				break;
			}
		}
		if (p==0)
		{
			i--;
			n--;
			p=1;
		}
		else
		{
			a[i]=m;
		}
	}
	for (j=0;j<n-1;j++)
	{
		printf("%d ",a[j]);
	}
	printf("%d",a[n-1]);
	return 0;
}
int main()
{
int n, j, k,m=1, x, a[1000];
scanf("%d",&n);
if(n==0) return 0;
scanf("%d",&x);
printf("%d",x); 
a[0]=x;
for(j=1; j<n; j++)
{
scanf("%d",&x); 
k=0;
while((k<m)&&(a[k]!=x)) 
k++;
if(k==m) {a[m++]=x;
printf(" %d",x);} 
}
return 0;
}
int stat[115],i,n,k,first=0;
int main(){
  for (i=0;i<110;i++) stat[i]=0;
  for (scanf("%d",&n),i=0;i<n;i++){
     scanf("%d",&k),stat[k]++;
     printf(stat[k]==1?"%s%d":"",i!=0?" ":"",k);
    
  }
  printf("\n");
  return 0;
}
int main()
{
	int a[20001]={0};
	int n, i, j, k, p, num=0;
	cin >> n;
	for(i=1; i <= n; i++) 
	{
		cin >> a[i];
	}
	for(j=1; j <= n-1; j++)
	{
		for(k=j+1; k <= n; )
		{
			if(a[j] == a[k])
			{
				for(p=k; p <= n-1; p++)
				{
					a[p]=a[p+1];
				}
				n--; 
			}
			else
			{
				k++;
			}
		}
	}
	for(i=1; i < n; i++)
	{
		cout << a[i] << " ";
	}
	cout << a[n] <<endl;
	return 0;
}
main()
{
	int a[105],n,i;
	for (i = 0;i < 101;i += 1)
		a[i] = 0;
	scanf("%d",&n);
	scanf("%d",&i);
	a[i] = 1;
	printf("%d",i);
	while(n-- > 1){
		scanf("%d",&i);
		if(a[i]) continue;
		a[i] = 1;
		printf(" %d",i);
	}
}
int main()
{
	int n,j;
	cin>>n;
	int a[n];
	int i=0;
	while (i<n)
	{
		cin>>a[i];
		i++;
	}
	cout<<a[0];
	i=1;
	while(i<n)
	{

		for(j=0;j<i;j++)
			if (a[i]==a[j]) break;
		if (((j==i)&&(a[i]!=a[i-1]))==1) cout<<" "<<a[i];
		i++;
	}
	return 0;

}
int main()
{
	int n,i,j,a,b=0,m,c[91]={0};
	scanf("%d",&n);
	for(i=0,m=0;i<n;i++)
	{
		b=0;
		scanf("%d",&a);
		for(j=0;j<91;j++)
		{
			if(c[j]==a)
				b=1;
		}
		if(b==0)
		{
			c[m]=a;
			m=m+1;
		}
	}
	printf("%d",c[0]);
	for(i=1;i<m;i++)
		printf(" %d",c[i]);
	return 0;
}
int main()

{  
	int n,i,a[20000],k,j=0;
	
	cin>>n;

	for(i=0;i<n;i++)
	{cin>>a[i];}
	
	cout<<a[0];

	for(i=1;i<n;i++)
	
	{
		for(k=0;k<i;k++)
	{
		
		if(a[i]==a[k]) {j=j+1;break;}
	}
		if(j==0) cout<<" "<<a[i];
		j=0;
	 
		
		
	}


	


	return 0;
}
int main()
{
    int n,k=2,i;
    scanf("%d",&n);
    int a[n+1];
    scanf("%d",&a[1]);
    printf("%d",a[1]);
    while(k<=n)
    {
     scanf("%d",&a[k]);
     i=1;
     while(i<=k-1)
     {
       if(a[i]==a[k]) break;
       else if(i==k-1) printf(" %d",a[k]);
       i=i+1;
       }
       k=k+1;
       }
      return 0;
}
int main()
{
	int n,a[20000]={0},i,j,b[20000]={0},p=1,m=0;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	
	for(i=n;i>=2;i--)
	{
		for(j=i-1;j>=1;j--)
		{if(a[i]==a[j]) m+=1;}
		if(m==0) {b[p]=a[i]; p++;}
		m=0;
	}
	p=p-1;
	b[p+1]=a[1];
	for(i=p+1;i>=2;i--)
	{cout<<b[i]<<" ";}
	cout<<b[1]<<endl;
	return 0;
}
/*
 * c.cpp
 * ???1100012870;
 * ???????
 *  Created on: 2011-10-19
 *      Author: Li Wenpeng
 */
int main()
{
	int n,a[20001],p[200],x,step=-1;
	cin>>n;
	memset(p,0,sizeof(p));
	memset(a,0,sizeof(a));
	for (int i=0;i<n;i++)                //????
	{
		cin>>x;
		if (p[x]==0)                     //?????????????????
				{
			step++;                      //????????1
			a[step]=x;
			p[x]=1;                      //???x?????
				}
	}
	cout<<a[0];
	for (int j=1;j<=step;j++) cout<<' '<<a[j];
	return 0;
}
int main()
{
	int i,j,t=1,sum,n;
	scanf("%d",&n);
	int x[20000],y[20000];
	for(i=0;i<n;i++) scanf("%d",&y[i]);
	x[0]=y[0];
	int k=0;
	for(i=1;i<n;i++)
	{
		sum=1;
		for(j=0;j<=k;j++) sum=sum*(y[i]-x[j]);
		if(sum!=0) {x[k+1]=y[i];k++;}
	}
         printf("%d",x[0]);
	for(i=1;i<=k;i++) printf(" %d",x[i]);
	printf("\n");
	return 0;
}
int main()
{
	int a[20001], i, flag[91] = {0}, n;
	cin >> n;
	for(i = 0; i < n; i++)
	
		cin >> a[i];
	cout << a[0];
	flag[a[0] - 10] = 1;
	for(i = 0; i < n; i++)
	{
		if(flag[a[i] - 10] == 0) 
		{
			cout << ' ' << a[i];
			flag[a[i] - 10] = 1;

		}
		else continue;
	}
	return 0;

}
int main()
{
int n,i,j,m=0;
int a[20001],b[20001];
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a[i];
}
for(i=1;i<=n;i++)
{
for(j=1;j<=i-1;j++)
{
if(a[i]==a[j])
break;
}
if(i==j)
{
m=m+1;
b[m]=a[i];
}
}
for(i=1;i<=m-1;i++)
{
cout<<b[i]<<" ";
}
cout<<b[m]<<endl;
return 0;
}
/*
 * NEWdelatethesamenumber.cpp
 *???????????
 *  Created on: 2011-10-22
 *      Author: ???
 */
int main ()
{
	int n,i,j,t=0;
	cin>>n;
	int a[10000];//????
	cin>>a[0];
	for(i=1;(i+t)<n;i++)//????
	{cin>>a[i];
	 for(j=0;j<i;j++)//????
	 {
		 if (a[i]==a[j])//????????
		 { i--;
		   t++;
		   break;

	 }}
	}
	for(i=0;i<n-t-1;i++)
		cout<<a[i]<<' ';//??
	cout<<a[n-t-1];
	return 0;
}
void main()
{
	int i,n,j,k=0,b=0;
	int a[20000],c[20000];
    scanf("%d",&n);
	
	for(i=0;i<n;i++)
	scanf("%d",&a[i]);	
	
			
   for(i=0;i<n;i++)
   {if(a[i]==0)continue;
		for(j=i+1;j<n;j++)
		{   
			if(a[i]==a[j])
				a[j]=0;
		}
   }
	for(i=0;i<n;i++)
	   {
		   if(a[i]!=0)
		   {c[k]=a[i];k++;}
		   else 
		    b=b+1;
	   }
     for(k=0;k<n-b-1;k++)printf("%d ",c[k]);printf("%d",c[n-b-1]);
		   
}
int main()
{
	int a[20001], count[101] = {0};
	int n, i;
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> a[i];
		count[a[i]]++;
	}
	cout << a[1];
	count[a[1]] = 0;
	for (i = 2 ; i <= n; i++)
	{
		if (count[a[i]] >= 1)
		{
			cout << " " << a[i];
			count[a[i]] = 0;
		}
	}
	cout << endl;
	return 0;
}