semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int n, a[20000], b[91], count = 0, i, j;
	cin >> n;
	for (i = 1; i <= n; i++)
		cin >> a[i];
	for (i = 1; i <= n; i++)
	{
		for (j = 1; j <= i; j++)
		{
			if (a[i] == a[j])
				break;
		}
		if (i == j)
		{
			count++;
			b[count] = a[i];
			if(count == 90)
				break;
		}
		if (count == 90)
			break;
	}
	if (count > 1)
	{
		for (i = 1; i <= count - 1; i++)
			cout << b[i] << " ";
		cout << b[count] << endl;
	}
	else if (count == 1)
		cout << b[1] << endl;
	return 0;
}
int main()
{
	int i, j, k = 1, l, m, n, a[20000], b[90], x;
	cin >> n;
	for (i = 0; i < n; i++)
		cin >> a[i];
	b[0] = a[0];
	for (j = 0; j < n; j++)
	{
		for (l = 0; l < k; l++)
		{
			if (a[j] == b[l])
			{m = 1;}
		}
		if (m != 1)
		{
			b[k] = a[j];
			k++;
		}
		m = 0;
	}
	cout << b[0];
	for (x = 1; x < k; x++)
		cout << " " << b[x];
	return 0;
}
main()
{
 int n,a[20000],j,temp;
 scanf("%d",&n);
 for(int i=1;i<=n;i++)
            {
             scanf("%d",&temp);
             if(i==1)
                       {
                        j=0;
                        printf("%d",temp);
                        a[j]=temp;
                       }
             else
                 {
                  int c=0;
                  for(int k=0;k<=j;k++)
                          {
                           if(a[k]==temp)
                           c++;            
                          }
                  if(c==0)
                           {        
                            printf(" %d",temp);
                            j++;
                            a[j]=temp;     
                           }             
                 }         
            }
 getchar();
 getchar();
}
void main()
{
	int n,i,a[20005],del,j;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=1;i<=n;i++)
	{
		del=a[i];
		if(a[i]>=10)
		{
			if(i==1)
			{
				printf("%d",a[1]);
			}
			else
			{
				printf(" %d",a[i]);
			}
		}
		for(j=i+1;j<=n;j++)
		{
			if(a[j]==a[i])
			{
				a[j]=0;
			}
		}
	}
}
int main()
{
    int n ;
    cin >> n ;
    int a[n];
    int i , j ;
    for ( i = 0 ; i < n ; i++ )
      {
          cin >> a[i] ;
      }
        cout << a[0] ;
    for ( i = 1 ; i < n ; i++ )
        {
            for ( j = 0 ; j < i ; j++ )
               {
                   if( a[j] == a[i] )
                   {
                       break;
                   }
                }
                if( i == j )//?????????????????????
                   {
                       cout << " " << a[i] ;//?????????????
                   }
        }
         return 0;
}
int main()
{

	int a[20000],i,n,k,j,m;
	scanf("%d",&n);m=n;
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
	{
		for(k=0;k<i;k++)
		{
			if(a[i]==a[k])
			{
		//	m--; 
			n--;
			for(j=i;j<n;j++)
			{
				a[j]=a[j+1];
			}i--;
			}
		}
		
	}
	for(i=0;i<n;i++)
    if(i<n-1)
	{printf("%d ",a[i]);}
	else {printf("%d",a[n-1]);}
	return 0;
}
int main()
{
	int n,a[20000],i=0,t=0,p=0;
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
	{
		scanf("%d",&a[i]);
			
	}
	for(i=0;i<=n-1;i++)
	{
	for(t=0;t<=i-1;t++)
		{
			if(a[i]==a[t])
				p++;
		}
    
	if(p!=0)
			a[i]=0;
	p=0;
	}
	for(i=0;i<=n-1;i++)
	{
		if(a[i]!=0)
		{printf("%d",a[i]); 
		break;}
	}
    for(t=i+1;t<=n-1;t++)
	{
		if(a[t]!=0)
			printf(" %d",a[t]); 
	}
}
void main()
{
	int a[20000],b[100],n,i,j,k,l;
	scanf("%d",&n);
	for(i=0;i<n;i++) scanf("%d",&a[i]);
	b[0]=a[0];
	l=0;
	k=0;
	for(i=1;i<n;i++)
	{
		for(j=0;j<=l;j++) if (a[i]==b[j]) k=1;
		if (k==0)
		{
			l++;
			b[l]=a[i];
		}
		k=0;
	}
	for(i=0;i<l;i++) printf("%d ",b[i]);
    printf("%d",b[l]);
}
int main()
{
    int n;
    scanf("%d",&n);
    int a[100];
    int i=0;
    int x;
    scanf("%d",&x);
    printf("%d",x);
    a[i]=x;
    i++;
    for(int j=1;j<n;j++)
    {
            int h;
            int k=0;
            scanf("%d",&h);
            for(int t=0;t<i;t++)
            {
                    if(h==a[t])
                    k=1;
            }
            if(k==0)
            {
                   printf(" %d",h);
                   a[i]=h;
                   i++;
            }
    }
    getchar();
    getchar();
}
int main()
{
	int n;
	scanf("%d",&n);
	int num[20001];
	memset(num,0,20001);
	int i,j;
	int count=1;
	int number;
	for(i=1;i<=n;i++)
	{
		scanf("%d",&number);
		if(i==1)
		{
			num[0]=number;
		}
		else
		{
			for(j=1;j<=count;j++)
			{
				if(number==num[j-1])
				{
					break;
				}
				else
				{}
				if(j==count)
				{
					count++;
					num[count-1]=number;
				}
				else
				{}
			}
		}
	}
	for(i=1;i<count;i++)
	{
		printf("%d ",num[i-1]);
	}
	printf("%d",num[count-1]);
	return 0;
}
int main(){
    int a[20001];
    int n,i,j,l,num;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%d",&a[i]);}
    num=0;
    for(i=1;i<=n;i++){
		for(j=1;j<i;j++){
			if(a[j]==a[i]){
            a[i]=0;
            num++;
            break;
			}
		}
		}
	j=0;
	for(i=1;i<=n;i++){if(a[i]!=0){
		j++;
		if(j!=n-num){
		printf("%d ",a[i]);}
		else{printf("%d",a[i]);
		break;}
	}}
	scanf("%d",&n);
	return 0;
}
void main()
{
	int a[20000];
	int i=0,n,j,k,m=1;
	scanf("%d",&n);
	for(k=0;k<n;k++)
		scanf("%d",&a[k]);
	k=0;
	while(i<n)
	{
		for(j=0;j<i;)
		{
			if(a[i]==a[j])
			{
				m=0;
				break;
			}
			else j++;
		}
		if(m==1)
		{
			a[k]=a[i];
			i++,k++;
		}
		else i++,m=1;
	}
	for(i=0;i<(k-1);i++)
		printf("%d ",a[i]);
	printf("%d\n",a[k-1]);
}
int main()
{
	int a[20000],count[100], n, i, j;
	cin >> n;
	for(i = 0; i <n;i++)
		cin >> a[i];
	for(i=0;i<100;i++)
		count[i]=0;
	cout << a[0];
	count[a[0]]++;
	for(i = 0, j = 1; j < n; j++)
	{
		if(count[a[j]] == 0)
		{
			i++;
			a[i] = a[j];
			count[a[j]]++;
		}
	}
	for(j = 1;j <= i;j++)
		cout <<" " << a[j];
	cout << endl;
	return 0;
}
int main()
{
    int i=1,n,j,r=0,a[20001],b[101];    //r?????????b???????? 
    cin>>n;
    memset(b,1,sizeof(b));              //?b????????1?????????0 
    
     do
      { 
       r=r+1;                      //?????? 
       cin>>j;                     //???????j    
       if (b[j]!=0)                //????????a????????? 
       {
       a[i]=j;
       b[a[i]]=0;
       i=i+1;
       }
       }
      while (r<n);
       
    for (j=1;j<i-1;j++)  cout<<a[j]<<' ';   
    cout<<a[i-1]; //?? 

    
    return 0;
}
int main()
{
	int n,a[20100],i,j;
	scanf("%d",&n);
	scanf("%d",a);
	printf("%d",*a);
	for(i=1;i<n;i++)
	{
		scanf("%d",a+i);
		for(j=0;j<i;j++)
		{
			if(a[j]==a[i]) break;
		}
		if(j==i) printf(" %d",*(a+i));
	}
}
int main()
{
    int n,i,m,save[20000],count=0;
    for(i=0;i<20000;i++)
    save[i]=0;
    cin>>n; 
    while(n--)
    {
              int flag=1;
              cin>>m;
              for(i=0;i<20000;i++)
              {if(save[i]==m) {flag=0;break;}
              }
              if(flag==1) 
              {
                          for(i=0;i<20000;i++)
                          {if(save[i]==0){save[i]=m;break;}}
                          count++;
                          }
                          }
                          for(i=0;i<count-1;i++)
                          cout<<save[i]<<" ";
                          cout<<save[count-1];
                          
                          return 0;
                          }
int main()
{
	int a[20002],b[20001],n,i,j;
	cin>>n;
	for(i=1;i<=n;i++)
		cin>>a[i];
	for(i=1;i<=n+1;i++)
		b[i]=0;
	a[n+1]=0;
	for(i=2;i<=n;i++)
	{
		for(j=1;j<i;j++)
			if(a[i]==a[j])a[i]=0;
	}
	for(i=1;i<=n;i++)
	{
		for(j=i+1;j<=n+1;j++)
			b[i]+=a[j];
	}
	for(i=1;i<=n;i++)
	{
		if(a[i]!=0&&b[i]!=0)
			cout<<a[i]<<" ";
		else if(a[i]!=0&&b[i]==0)
			cout<<a[i]<<endl;
	}
	return 0;
}
main(){
       int input[20000],output[20000],n,i,j,outLen=1;
       scanf("%d",&n);
       for(i=0;i<n;i++){
           scanf("%d",&input[i]);
           output[outLen]=input[i];
           for(j=1;j<outLen;j++){
               if(input[i]==output[j]) outLen=outLen-1;
               /*else output[outLen]=input[i]; */
               
           }
           outLen=outLen+1;
       }
       
       for(i=1;i<outLen;i++){
           printf("%d",output[i]);
           if(i!=outLen-1) printf(" ");
       }
       
}
int main()
{
	int i,j,count=0,p=0,n;
	int a[20002]={0},b[20002]={0};
	cin >>n;
	for(i=1;i<=n;i++)
	{
		cin >> a[i];
	}
	for(i=1;i<=n;i++)
	{
		for(j=1;j<i;j++)
		{
			if(a[i]==a[j])b[i]=1;
		}
		if(b[i]==0)count=count+1;
	}
	for(i=1;i<=n;i++)
	{
		if(b[i]!=1)
		{
			p=p+1;
			if(p!=count)cout<<a[i]<<" ";
			else cout<<a[i]<<endl;
		}
	}
	return 0;
}
/*
 * 87.cpp
 *
 *  Created on: 2011-10-19
 *      Author: think
 */
int main(){//?????
	int n,p=1,i=0,j=0;//??????
	cin>>n;//????????
	int a[n];//????
	for(i=0;i<n;i++){//????
		cin>>a[i];
	}
	int b[n];//????????
	b[0]=a[0];//????
	for(i=1;i<n;i++){//????
		for(j=0;j<i;j++){//?????????????
			if(a[j]==a[i]){
				break;
			}}
			if(j==i){//???????bn??
				b[p]=a[i];
				p++;
			}

	}

	cout<<b[0];//????

	for(i=1;i<p;i++){//????
		cout<<" "<<b[i];
	}
	return 0;
}//?????
int main()
{
	int a[20000], b[101], c, i, j, n;
	for (i = 10;i <= 100;i++)
	{
		b[i] = 0;
	}
	cin >> n;
	for (i = 0;i < n;i++)
	{
			cin >> a[i];
			c = a[i];
			if (b[c] == 0)
				b[c]++;
			else
				a[i] = 0;
	}
	cout << a[0];
	for (j = 1;j < n;j++)
	{
			if (a[j] != 0)
				cout << " " << a[j];
	}
	

		return 0;
}
int main()
{
    int n,num,e[20001],i,j;
    scanf("%d/n",&n);
    if(n==1)
    {
           scanf("%d",&num);
           printf("%d",num);
    }else{ 
           for(i=1;i<=n;++i)
           {
                     scanf("%d",&num);
                     e[i]=num;
                     if(i==1)
                     {
                             printf("%d",e[1]);
                     }else{
                            for(j=1;j<i;j++)
                            {
                                      if(e[i]==e[j])
                                      {
                                         e[i]=0;
                                               break;
                                                    }
                                                    }
                                                    if(e[i]!=0)
                                                    {
                                                               printf(" %d",e[i]);
                                                               }
                                                               }
                                                               }
                                                               }
                                                               return 0;
                                                               }
/*
 *  1000012850_26.cpp
 *  ???????????
 *  Created on: 2010-10-29
 *  Author: William
 */
int main()                         //???
{                                  //?????
	int n,num;                   //??????n num b
	cin>>n;                        //??n
	int a[n];                      //??????a[n]
	for(num=0;num<=(n-1);num++)    //for??
	{
		cin>>a[num];
	}                              //??????????? ??????????n?????
    int i,k,q;                     //??????i k q
    cout<<a[0];                    //??a[0]
    for(k=1;k<=n-1;k++)            //for?? ????a[k]???????????
    {
    	q=0;                       //q??0
    	for(i=0;i<k;i++)           //for??
    	{
    		if(a[k]==a[i]){
    		q++;
    		}                      //???????? ??q??
    	}
    	if(q==0)                   //??q?0 ??????a[k]
    	{
    	cout<<" "<<a[k];
    	}
    	}
return 0;                          //??
    }                              //??
int main(){
int n,k,w[200];
cin>>n;memset(w,0,sizeof(w));
for(int i=0;i<n;i++){
cin>>k;
if(!w[k]){
if(i)cout<<' ';
w[k]=1;
cout<<k;
}
}
return 0;
}
int main()
{
	int a[20000],n,i,j,k;
	i=0;
	k=1;
	scanf("%d",&n);
	if(n==1)
	{
		scanf("%d",&a[i]);
	    printf("%d",a[i]);
	}
	else
	{
		scanf("%d",&a[i]);
	    printf("%d",a[i]);
		for(i=1;i<n;i++,k++)
	{
		scanf("%d",&a[i]);
		for(j=0;j<i;j++)
		{
			if(a[i]==a[j])
				break;
		}
		if(k<(n-1))
		{if(i==j)
		printf(" %d",a[i]);}
		else
		{
				for(j=0;j<i;j++)
		{
			if(a[i]==a[j])
				break;
		}
				if(i==j)
			printf(" %d",a[i]);
		}
	}}
	return 0;
}
int main()
{
	int a[20000], n, i, j, b[20000] = {0};
	cin >> n;
    for(i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	for(i = 0; i < n; i++)
	{
		for(j = i + 1; j < n; j++)
		{
			if(a[j] == a[i])
			{
				b[j]++;
			}
		}
	}
    cout << a[0];
	for(i = 1; i < n; i++)
	{
        if(b[i] == 0)
		{
			cout << ' ' << a[i] ;
		}
	}
	return 0;
}
int main()
{
	int b[20000]={0},a[20000],i,n,j,flag = 0;
	cin>>n;
	for(i=0;i<=n-1;i++)
		cin>>a[i];
	for(i=0;i<=n-1;i++)
		for(j=n-1;j>=i+1;j--)
			if(a[i]==a[j])b[j]=1;
	for(i=0;i<=n-1;i++)
		if(b[i]==0)
		{
			if(flag==0)
			{
				cout<<a[i];
				flag=1;
				continue;

			}
			cout<<" "<<a[i];
		}
	return 0;
			}
int main(){
	int n,m[20001]={0},i;
	cin>>n;
	for(i=1;i<=n;i++)
		cin>>m[i];
	for(i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
			if(m[i]==m[j])
				{for(j;j<=n;j++)
					m[j]=m[j+1];
				n=n-1;
				i=i-1;
			}
	for(i=1;i<=n-1;i++)
		cout << m[i] <<' ';
	cout << m[n] << endl;
	return 0;
}
int main()
{
	
	int n,b,c,d,i,a[20000]={0};
	cin>>n;
	for (i=1;i<=n;i++)
	{
		cin>>b;
		a[i]=b;
	}
	cout<<a[1];
	for (c=2;c<=n;c++)
	{
		for (d=0;d<=c-1;d++)
		{
			if (a[d]==a[c])
				break;
			else continue;
		}
		if (d==c)
		{
			cout<<" "<<a[c];
		}
	}

	return 0;
}
/*
 * 01.cpp
 *?? - ??(13-9) ???????? 
 *  Created on: 2012-11-11
 *      Author:???
 */
int main()
{
	int N,i,j,k,m=0;//????
	cin>>N;
	const int n=N;
	int a[n];
	for(i=0;i<n;i++)//?????
	{
		cin>>a[i];
	}
	for(i=0;i<n-m;i++)//????????
		for(j=i;j<=n-m;j++)//???????????????????
		{
			if(a[i]==a[j+1])//????????
			{
				for(k=j+1;k<n-m;k++)//??????????????????
					a[k]=a[k+1];
					m++;
					j--;
			}
		}
	cout << a[0];//????????
		for (i = 1; i < n - m; i++) {

			cout << " " << a[i];
		}
		return 0;
}
/*
 * 1000012889_26.cpp
 *
 *  Created on: 2010-10-31
 *      Author: ???
 *        ????????????
 */



int main(){
	int m,i,j;
	cin>>m;
	int a[m];                         //????
	for(i=0;i<m;i++){
		cin>>a[i];                    //???
		for(j=0;j<i;j++)              //??????????????
			if(a[j]==a[i])
				break;
		if(j==i){
			if(j==0)
				cout<<a[i];
			else cout<<" "<<a[i];
		}

	}
	return 0;
}
main()
{
      int n;
      scanf("%d",&n);
      int s[20000],y[20000];
      int i,j,k;
      for(i=0;i<n;i++)
      {
                      scanf("%d",&s[i]);
      }
      k=0;
      for(i=n-1;i>0;i--)
      {
                      for(j=i-1;j>=0;j--)
                      {
                                         if(s[i]==s[j])
                                                break;
                      }
                      if(j==-1)
                      {
                               y[k]=s[i];
                               k++;
                      }
      }
      printf("%d",s[0]);
      for(i=k-1;i>=0;i--)
            printf(" %d",y[i]);
}
main()
{
      int n,i,j;
      int a[20000];
      scanf("%d",&n);
      for(i=0;i<n;i++)
        scanf("%d",&a[i]);
      for(i=1;i<n;i++)
        for(j=0;j<i;j++)
        {
            if(a[i]==a[j]&&a[i]!=0)
                a[i]=0;
        }
        for(i=0;i<n;i++)
        {
              if(i==0)
                 printf("%d",a[i]);
                 else
                   {
                       if(a[i]!=0)
                       printf(" %d",a[i]);
                   }
        }
    
}
int main()
{
	int n,i,j,a[20000],b=0,m=0,k=0;
	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]) a[j]=0;
	   }
	}
	for(i=0;i<n;i++)
	{
		if(a[i]!=0) m=m+1;
	}
	for(i=0;i<n;i++)
	{
		if(a[i]!=0) k=k+1;
		if(a[i]!=0&&k<m) printf("%d ",a[i]);
		if(a[i]!=0&&k==m) printf("%d",a[i]);
	}
}
/*
 * ???????.cpp
 *
 *  ??: 2012-11-3
 *  ????????
 */
int main()
{
	int n,i,j,m=0;                     //????
	cin>>n;                            //????
	int a[n];                          //????
	for(i=0;i<n;i++)                   //??????
		cin>>a[i];
	for(i=0;i<n;i++){                  //????
		int t=0;                       //???t
 		for(j=0;j<i;j++)               //??????????
			if(a[i]==a[j])
	           {t++;                   //?????t?????????
				break;
				}
	if(t==0){                         //?t??0
		if(m>0) cout<<" ";            //?????????????
		cout<<a[i];                   //????
		m++;
	}
	}
	return 0;

}
void main()
{
	int n,i;
	int a[20005],mark[100]={0},print=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d",a+i);
	for(i=0;i<n;i++){
		if(mark[a[i]]==1)continue;
		else{
			if(print)printf(" ");
			printf("%d",a[i]);
			print=1;
			mark[a[i]]++;
		}
	}
	putchar(10);
}
//
//	file	1000012765_2.cpp
//	author	???
//	date	2010.10.29
//	desc
//		????????
//
int main()
{
	int n, a[20001] = {0}, i, j, count = 0;	//	????????? ????????
	cin >> n;	//	????????
	for(i = 0; i < n; i++)
		cin >> a[i];	//	???????
	for(i = 0; i < n - 1; i++)
		for(j = n - 1; j > i; j--)
		{
			if(a[i] == a[j])
				a[j] = a[20000];	//	???????????????0
		}
		for(i = 0; i < n; i++)
		{
			if(a[i] != 0 && count == 0)
			{
				cout << a[i];
				count++;
			}
			else if(a[i] != 0)
				cout << " " << a[i];	//	???????0??????
		}
		return 0;
}
//********************************
//?????????????
//???:??
//?????2010.10.29
//?????????????
//********************************
int main()
{
	int n,num,a[20001];       //????????????
	cin >> n;
	for (int i = 1; i <= n; i++) //??????
	{
		cin >> num;
		a[i-1] =num;
		if ( i== 1)           //?????????
			cout << num;
		else
		{
			int j = 0;
			while (j < i-1)//???????????
			{
				if (a[j] ==num )
					break;
				else
					j++;
			}
			if (j == i-1)
				cout << " " << num;//???????????????????
		}		
	}
	cout << endl;
	return 0;
}
/*
 * 1000012712_26.cpp
 * Author: ???
 * Created on: 2010-11-4
 * ?????????????
 */
int main(){
	int n;
	cin>>n;             //????????
	int a[20001];       //????
	int i;
	for(i=1;i<=n;i++)
		cin>>a[i];      //??n??
	int j=1;            //??????
	for(i=2;i<=n;i++){  //??????????
		for(j=1;j<i;j++){
			if(a[i]==a[j]){
				int u=i;
				if(a[i]==a[i+1])
					j--;
				while(i<n){
					a[i]=a[i+1];//???????????
					i++;
				}
				i=u;
				n--;
				i--;
			}
		}
	}
	for(i=1;i<n;i++)              //????????
			cout<<a[i]<<" ";
		cout<<a[n]<<endl;
	return 0;
}
int num[100000], n, i, j, k, m, l;
int main()
{
	cin >> n;
	for(i = 0; i < n; i++)
	{
		cin >> num[i];
	}
	for(j = 0; j < n - 1; j++)
		for(k = j + 1; k < n; k++)
		{
			if(num[j] == num[k]) 
				{num[k] = 0;}
		}
	for(m = 0, l = 0; m < n; m++)
	{
		if(num[m] >= 10) 
		{	
			l++;
			if(l == 1) {cout << num[m];}
			else {cout << " " << num[m];}
		}
	}cin>>i;
	return 0;
}
int main()
{
int a[10000],i,j,n,t,count;
scanf("%d",&n);
for(i=0;i<n;i++)
{
	scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{t=0;count=0;
	for(j=i;j>=0;j--)
	{count++;
		if(a[i]==a[j]&&(i!=j) )
		{t=1;
		break;}
	}
	if(t==0&&count==1)
	{
		printf("%d",a[i]);}
	else if((t==0)&&(count!=1)) 
	{
        printf(" %d",a[i]);
	}
     
} 
	return 0;
}
main()
{
      int i,j,n;
      scanf("%d",&n);
      int a[20000];
      for(i=0;i<n;i++)
      {
                      scanf("%d",&a[i]);
                      }
      printf("%d",a[0]);
      for(i=1;i<n;i++)
      {
                      int k;
                      k=0;
                      for(j=0;j<i;j++)
                      {
                                      if(a[j]!=a[i]) k++;
                                      else break;
                                      }
                                      if(k==i) printf(" %d",a[i]);
                      }
      getchar();getchar();getchar();getchar();getchar();
      }
void main()
{
	int n,i,m,k=0,t,a[20001];
	scanf("%d\n",&n);
	for(i=0;i<n;i++) scanf("%d",&a[i]);
	for(i=1;i<n-k;i++) 
	{
		for(m=1;m<=i;m++)
		{
			if(a[i]==a[i-m])
			{
			       t=i;
			       for(i=t;i<n-k;i++) a[i]=a[i+1];
			       i=t-1;
			       k++;
			}
		}
	}
	for(i=0;i<n-k-1;i++) printf("%d ",a[i]);
	printf("%d",a[n-k-1]);
}
void main()
{
   int n,m,i,j,k;
   scanf("%d\n",&n);
   int a[n],b[n];
   k=0;
   for(i=0;i<n;i++){scanf("%d ",&a[i]);}
   for(i=n-1;i>0;i--)
     {
       m=0;
       for(j=i-1;j>=0;j--){if(a[i]!=a[j]) m=m+1;}
	   if(m==i){b[k]=a[i];k=k+1;}
      	  
   }
   b[k]=a[0];
   for(i=k;i>0;i--)printf("%d ",b[i]);
   printf("%d",b[0]);
}
int shuzu[20000];
int main(){
    int n,x;
    scanf("%d",&n);
    for (int t=0;t<n;t++){
        scanf("%d",&shuzu[t]);
    }
    for (int j=0;j<n;j++){
        for (int i=j+1;i<n;i++){
           if (shuzu[i]==shuzu[j]){
                     shuzu[i]=0;
                }
           }
    }          
    for (int m=0;m<n;m++){
        if (shuzu[m]!=0){
            if (m==0){
            printf("%d",shuzu[m]);
            }
            else {
                   printf(" %d",shuzu[m]);    
                   }
        }
    } 
return 0;    
}
void main(void)
{
	int n;
	scanf("%d",&n);

	int i,k=0,a[90],b[20000];

	for(i=0;i<=89;i++)
		a[i]=i+10;

	for(i=0;i<=n-1;i++)
		scanf("%d",&b[i]);

	for(i=0;i<=n-1;i++)
	{
		int j;
		for(j=0;j<=89;j++)
		{
			if(b[i]==a[j])
			{
				if(k==0)
					printf("%d",a[j]);
				else
					printf(" %d",a[j]);
				a[j]=0;
				k++;
				break;
			}
		}
	}

	printf("\n");
}
void main()
{
	int n,a[20000],b[20000],i,j,k=0;
	scanf("%d\n",&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[i]==a[j])
				a[i]=0;
			else
				a[i]=a[i];
			}
		}
		if (a[i]!=0)
		{
			b[k]=a[i];
	    	k=k+1;
		}
	}

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

	for(i=a+1;i<n;i++){
		if(t[i]!=101){
			printf(" %d",t[i]);
		}

	}
	return 0;
}
int main()
{
	int a[101]={0};
	int n,b[20001],i,j=0,c[20001];
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&b[i]);
	}
	for(i=1;i<=n;i++)
	{
		if(a[b[i]]==0)
		{
			j++;
			c[j]=b[i];
			a[b[i]]=1;
		}
	}
	for(i=1;i<=j;i++)
	{
		printf("%d",c[i]);
		if(i!=j)
			printf(" ");
	}
	return 0;
}
/*
 * test.cpp
 *
 *  Created on: Nov 7, 2012
 *      Author: Sheldon
 */

int main(){
	int flag[101] = {0};
	int n, a;
	cin >> n;
	int f = 0;
	for(int i = 0; i < n; i ++){
		cin >> a;
		if(flag[a] == 0){
			flag[a] = 1;
			if(f == 0){
				cout << a;
				f = 1;
			}
			else{
				cout << " " << a;
			}
		}
	}
	return 0;
}
int main()
{int i,j,n,a[20000]; //????????n?????i,k???a??????
   cin>>n;

   for(i=0;i<n;i++){cin>>a[i];}//????
   if(n>1)
  {
   for(i=1;i<n;i++)
  for(j=0;j<i;j++)
  if(a[i]==a[j])a[i]=0;//?????????????????????0
  cout<<a[0];
  for(i=1;i<n;i++){if(a[i]!=0)cout<<" "<<a[i];}//????0????????
  }
   if(n==1)cout<<a[0];
 return 0;
}
int main()
{
	int a[20000],k,j,b,c,d,e,f,i;
	scanf("%d",&b);
	for(i=0;i<b;i++)
	{scanf("%d",&a[i]);}
	printf("%d",a[0]);
	for(j=1;j<b;j++)
	{for(k=0;k<j;k++)
	{if(a[k]==a[j])break;}
	if(k==j)printf(" %d",a[j]);}
	return 0;
}
void main()
{
	int n,i,j,m=1,k=1,a[20000],b[20000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%d",&a[i]);
	b[0]=a[0];
	
	for(i=1;i<n;i++){
		for(j=0;j<i;j++){
		    if(a[i]==a[j])
		    k=0;
		}
		    if(k==1){
		    	b[m]=a[i];
		    	m++;
		    }
		    k=1;
	}
		    	
	for(j=0;j<m-1;j++)
	printf("%d ",b[j]);
	printf("%d",b[j]);
}
int main()
{ int n,i,k;
  int a[20000];
  scanf("%d\n",&n);
  for (i=0;i<=(n-1);i++)
  scanf("%d",&a[i]);
  for (i=(n-1);i>=0;i--)
     { for (k=i-1;k>=0;k--)
       if ((a[i]-a[k])==0) {a[i]=0;break;}
      } 
  if (a[0]>9) printf("%d",a[0]);
   for (i=1;i<=(n-1);i++)
  {if (a[i]>9)
   printf(" %d",a[i]);
   } 
   }