semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int n,num[20001],sum=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>num[i];
	}
	for(int i=0;i<n;i++)
		for(int j=i+1;j<n;j++){
			if(num[i]==101)break;
			if(num[j]==num[i])num[j]=101;  //?????????????
		}
			        
	for(int i=0;i<n;i++){
				if(num[i]==101&&num[i+1]!=101){//????????????????
				for(int m=i;m<n;m++){
					num[m]=num[m+1];
				}
				sum++;
				}
				else if(num[i]==101&&num[i+1]==101){
				for(int m=i;m<n;m++){
					num[m]=num[m+1];
				}
				sum++;
					i--;
				}
			}
		for(int i=0;i<n-sum-1;i++){
			cout<<num[i]<<" ";}
		cout<<num[n-sum-1];
			return 0;
}
int main()
{
	int n,i,a[100000],sum=0,j;
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
	{
		scanf("%d",&a[i]);
	}
	if(n==1)
	{
		printf("%d",a[0]);
	}
	else
	{
		printf("%d",a[0]);
		for(i=1;i<=n-1;i++)
		{
			sum=0;
			for(j=0;j<=i-1;j++)
			{
				if(a[i]==a[j])
				{
					sum=1;
				}
			}
			if(sum==0)
			{
				printf(" %d",a[i]);
			}
		}
	}
}
/************************
???????????
???:???
*********************/
int main ()
{
	int a[20000],n,i,j;              //????n,i,j,n?????????a[20000]???
	cin>>n;                             //??n
	for(i=0;i<n;i++)            //??????
		cin>>a[i];                //??a[i]
	for(i=0;i<n;i++)                   //????
	{
		for(j=n-1;j>i;j--)
		{
			if( a[j]==a[i])               //????,??a[j]=a[i]?a[j]=-1
		a[j]=-1;
		}
	}
	cout<<a[0];                         //??a[0]
	for(i=1;i<n;i++)            //????
	if(a[i]!=-1)
		cout<<" "<<a[i];         //??a[i]?????????????a[i]
	return 0;
}
/*
 *????HW5_02.cpp
 *??????1100019007?
 *???2012-10-29
 *???????????
 */ 
int src[20000];//???
int dst[100];//????? 
int main()
{
  int n,i,j,flag;//??n,i,j
  int current_pos=0;//dst????
  cin>>n; 
  for(i=0;i<n;i++)cin>>src[i];//???? 
  for(i=0;i<n;i++)
  {
        if(current_pos)
        {
            flag=1;
            for(j=0;j<current_pos;j++)
            {
                if(dst[j]==src[i])flag=0;//??????????flag???0 
            }
            if(flag==1)
            {
                dst[current_pos]=src[i];
                current_pos++;
            }
        }
        else
        {
            dst[0]=src[0];
            current_pos++;
        }
  }
  for(i=0;i<current_pos;i++){
        cout<<dst[i];//???? 
        if(i<current_pos-1)cout<<" ";
    }
  cout<<endl;
  return 0;//????
}
/*
 * ????shuchushuzi.cpp
 * ??????
 * ?????2012 11 10
 * ???????????
 */



int main(){
    int n,m,i,j,k;  //????
    cin >>n;        //??????
    int N[n];
    for (i=0,k=0;i<n;i++,k++){    //???????
    	cin >>N[k];
    for (j=0;j<k;j++){
    	if (N[j]==N[k]) k--;  //????????????????????????????????????
    }
    }
    for (i=0;i<k;i++){
    	if (i==(k-1)) cout <<N[i];
    	else cout<<N[i]<<" ";    //????????
    }
    return 0;
}
int main()
{
	int a[200000],n,m,i,j;
	cin >>n;
	for(i=0;i<n;i++)
	{
		cin >>a[i];
	}
	i=0;
	while(i<n)
	{
		m=0;
		for(j=0;j<n;j++)
		{
			if(a[i]==a[j]&&i>j)
			{
				m=m+1;
			}
		}
        if(m==0&&i==0)
		     cout<<a[i];
	    if(m==0&&i!=0)
		     cout<<' '<<a[i];
		i=i+1;
	}
	return 0;
}
/*
 * ????????????
 * ??? ???
 * ?????  2010-11-3
 * ???????????????????????
 */



int main(){
	int n, i, temp;		//n???????????i?????temp??????
	cin >> n;			//?????
	const int N = n;
	int ia[N];			//????

	for(i=0; i!=n; i++) //????
		cin >> ia[i];

	i=1;
	while(i<n){		//
		temp = n;	//??n????????
						//for??????????????
		for(int j=0; j<i; j++){
			if(ia[i] == ia[j]){		//??????????
				for(int k=i; k<n-1; k++)
					ia[k] = ia[k+1];
				n--;
				break;
			}
		}
		if(n == temp) i++;	//?????????????????
	}

	for(i=0; i<n-1; i++)	//???????
		cout << ia[i] << " ";
	cout << ia[n-1] << endl;

	return 0;	//????
}
int main()
{
	int n,a[20000],i,j,b[20000],m=0,k;
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	b[0]=a[0];
	for(i=1,j=1;i<n;i++)
	{
		for(k=0;k<j;k++)
			if(a[i]==b[k])
				m=1;
		if(m!=1)
		{
			b[j]=a[i];
			j++;}
		m=0;}
	for(i=0;i<j-1;i++)
		cout<<b[i]<<' ';
	cout<<b[j-1]<<endl;
	return 0;
}
//**********************
//file homework 5      *
// author ??         *
//data 10/10/29        *
// ?? ??????? *
//**********************

int main ()
{ 
	int i, n, j, c;
	int a[20000] = {0};
	cin >> c;
	for(i = 0;i < c;i ++)
	{cin >> a[i];}
	cout<<a[0];
	for(n = 1; n < c; n ++)
	{
		for(j = n - 1; j >= 0; j --)
		{if (a[j] == a[n])
		break;
		else
			continue;
		}
		if (j == -1)
			cout<<" "<<a[n];
	}

	return 0 ;
}
int main()
{
	int n;
	cin >> n;
	int a, i, j, l, k = 1;
	cin >> a;
	int s[20000] = {a};
	for (i = 1; i < n; i ++)
	{
		cin >> a;
		j = 0;
		while (s[j] != a)
		{	j ++;
		    if (j == k)
			{	
				s[k] = a;
			    k ++;
			}
		}
	}
	for (l = 0; l < k - 1; l ++)
		cout << s[l] << ' ';
	cout << s[k - 1];
	return 0;
}
int main()
{
	int i,n,j;
	int a[20000];
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<=n-1;i++)
	{
		if(i==0)printf("%d",a[i]);
		else
		{
			for(j=0;j<i;j++)
			{
				if(a[i]==a[j])break;
			}
			if(j==i)printf(" %d",a[i]);
		}
	}
}
/*
 * ????????.cpp
 *
 *  Created on: 2011-10-21
 *      Author: sony
 */
int main()
{
	int n,i,j,q=0,a[20000];
	cin>>n;
	for(i=0;i<n-q;i++)
	{
		cin>>a[i];
		for(j=0;j<i;j++)
		{
			if(a[i]==a[j])
			{
				q++;
				i--;
			}
		}
	}
	for(i=0;i<n-q-1;i++)
		cout<<a[i]<<" ";
	cout<<a[n-q-1];
	return 0;
}
int main()
{
	struct number
	{
		int num,status;
	}
	a[20000];
	int n,i,j,count;
	scanf("%d",&n);
	count=n;
	for (i=0;i<n;i++)
	{
		scanf("%d",&a[i].num);
		a[i].status=1;
	}
	for (i=0;i<n;i++)
	{
		for (j=0;j<i;j++)
		{
			if (a[i].num==a[j].num)
			{
				a[i].status=0;
				count--;
				break;
			}
		}
	}
	for (i=0,j=0;i<n;i++)
	{
		if (a[i].status && j!=count-1)
		{
			printf("%d ",a[i].num);
			j++;
			continue;
		}
		if (a[i].status && j==count-1)
		{
			printf("%d\n",a[i].num);
			break;
		}
	}
	return 0;
}
void main()
{
  int n,a[20000],b[20000],i,j,k;
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&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(b[j]==a[i])
            {
              b[j]=0;
            }
        }
    }
  printf("%d",b[0]);
  for(i=1;i<n;i++)
    if(b[i]!=0)printf(" %d",b[i]);
}
int main()
{
	int n;
	int number[1000000];
	cin >> n;
	for (int i1=0;i1<n;i1++)
	{
		cin >> number[i1];
	}
	for (int i2=0;i2<n;i2++)
	{
		for (int i3=i2+1;i3<n;i3++)
		{
			if (number[i2]==number[i3])
			{
				number[i3]=0;
			}
		}
	}
	cout << number[0];
	for (int i4=1;i4<n;i4++)
	{
		if (number[i4]!=0)
		{
			cout <<  " " <<number[i4];
		}
	}
	return 0;
}
int main()
{
     int n,a[20000],i,j,m=0;
     scanf("%d",&n);
     for(i=0;i<n;i++){
                       scanf("%d",&a[i]);}
                       for(i=0;i<n;i++){
                                        m=0;
                           for(j=0;j<i;j++){
                                            if(a[j]==a[i])
                                            m=1;
                                            }
                                            if (m==0&&i==0)
                                            printf("%d",a[i]);
                                            if(m==0&&i>0)
                                            printf(" %d",a[i]);
                                            }            

            return 0;
              }
int main()
{
	int i,j,n,m,b,a[20000];
	i=0;
	scanf("%d\n",&n);
	for(;i<=n-1;i++)
	{
		if(i<n-1)
		scanf("%d ",&a[i]);
		else 
		scanf("%d\n",&a[i]);
	}
		for(j=0;j<n;j++)
	{
	    if(j==0)
			printf("%d",a[j]);
		else
		{
			for(m=0,b=0;m<j;m++)
			{
				if(a[j]==a[m])
					b++;
			}
			if(b==0)
				printf(" %d",a[j]);
		}
	}
	return 0;
}
int main ()
{
	// ????????
	// ??? ??? ???????
	// ???k??? ???k-1?????? ????? ????????
	// ??????
	int n, i, j, k, p, t;
	int a[20002];
	cin >> n;
	cin >> a[0];
	p = 0;
	for (i = 1; i <= n - 1; i++)
	{
		cin >> k;
		t = 0;
        for (j = 0; j <= p; j++)
		{
			if (a[j] == k)
			{
				t = 1;
				break;
			}
		}
		if (t == 1) continue;
		else
		{
			p = p + 1;
			a[p] = k;
		}
	}
	cout << a[0];
	for (i = 1; i <= p; i++)
	{
		cout << " " << a[i] ; 
	}
	cout << endl;
	return 0;
}
int main(){
	int n,i,j,k=0,h=0;	//???????n?????????i?j??????k??????????h??????????
	cin>>n;	//??n
	int a[n],b[n];	//??a?b????
	for (i=0;i<=(n-1);i++)	//????????a????
		cin>>a[i];
	for (i=0;i<=(n-1);i++){
		if (a[i]!=-1){	//?a?????-1?
			for (j=i+1;j<=(n-1);j++){	//????????????
				if (a[i]==a[j]){	//????????
					a[j]=-1;	//?????????-1
					k=k+1;	//?????
				}
	      }
		}
	}
	for (i=0;i<=(n-1);i++)	//?a?????????b?
		b[i]=a[i];
	for (i=0;i<=(n-1);i++){	//????????
		if (b[i]!=-1){	//?b?????-1?
			cout<<b[i];	//??????
			h++;	//?????
			}
		if (h==1)	//???????-1???
			break;	//????
	}
    for (i=i+1;i<=n-1;i++){	//?????-1?????????
    	if (b[i]!=-1){	//?b?????-1?
    	    		cout<<" "<<b[i];	//??????
    	    		h++;	//?????
            }
    	if (h==n-k)	//?????????????????????????
    		break;	//????
    }

	return 0;
}
int a[20010];

void main()
{
	int n,i,tmp,k,ii=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&tmp);
		int j;
		int flag = 0;
		for(j=0;j<i;j++)
		{
			if(a[j]==tmp)
			{
				flag = 1;
			}
		}
		if(flag == 0)
		{
			a[ii] = tmp;
			ii++;
			//printf("%d\n",tmp);
		}
		
	}
	for(k=0;k<ii-1;k++)
	{
		printf("%d ",a[k]);
	}
	printf("%d",a[ii-1]);
	
}
int main()
{
	int n,i,j,k;
	int a[20000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{scanf("%d",&a[i]);
	printf("\n");
	}
	printf("%d",a[0]);
	for(i=1;i<n;i++)
	{for(j=0,k=0;j<i;j++)
	{if (a[i]==a[j])
	k++;
	}
	if(k==0)
	printf(" %d",a[i]);
	}
	printf("\n");
	return 0;
}
int main()
{
    int n,a[20000],i,j,k=0;
    scanf("%d\n",&n);
    for(i=0;i<n;i++)
    {
                    // a[i]>=10&&a[i]<100;
                    scanf("%d",&a[i]);
                    //a[i]>=10&&a[i]<100;
    }
    printf("%d",a[0]);
    for(i=1;i<n;i++)
    {
                    for(j=0;j<i;j++)
                    {
                                    if(a[i]==a[j])
                                    k=k+1;
                    }
                    if(k==0)
                    printf(" %d",a[i]);
                    k=0;
                    
    }
    getchar();
    getchar();
}
int main()
{
	int n,a[20000]={0};
	cin>>n;
	int count=n;
	for(int i=1;i<=n;i++)
	cin>>a[i];
	for(int i=1;i<=n;i++)
	{
		if(a[i]!=0)
		{
		for(int j=i+1;j<=n;j++)
			if(a[j]==a[i]) {a[j]=0;count-=1;}
		}
	}
	if(count>1)
	{
		int i;
		for(i=1;i<=n;i++)
		{
			if(a[i]!=0)
				{
					cout<<a[i]<<' ';
					count--;
			}
			if(count==1) break;
		}
		for(i=i+1;i<=n;i++)
			if(a[i]!=0) cout<<a[i];
	}
	else 
		for(int i=1;i<=n;i++)
			if(a[i]!=0) cout<<a[i];
		return 0;
}
void main()
{
	int n,i;
	int a[100000];
	scanf("%d/n",&n);
	for(i=0;i<n;i++)
	scanf("%d",&a[i]);
	printf("%d",a[0]);
	i=1;
	while(i<n)
	{
		int j=0,x=0;
		while(j<i)
		{
			if(a[i]==a[j])
			{
				x=1;
				break;
			}
			j++;
		}
		if(x==0)
		printf(" %d",a[i]);
		i++;
	}
}
int main(){
	int a[10000]={0},t[10000]={0},s,b,c,k=0,i=0,n;
	scanf("%d",&n);
	printf("\n");
	scanf("%d",&a[0]);
	for(i=1;i<=n-1;i++)
	{
		scanf("%d",&a[i]);
		for(b=0,c=0;b<=i-1;b++)
			if(a[i]==a[b]) c=c+1;
        if(c==0)
		{t[k]=a[i];
		k++;
		}
	}
	if(k==0)printf("%d",a[0]);
	if(k>0){
	printf("%d ",a[0]);
	for(s=0;s<=k-2;s++)
	printf("%d ",t[s]);
	printf("%d",t[k-1]);}
return 0;
}
int main()
{
	int n,b;
	int m[20002];
	int i=1;
	int a=2;
	int num;
	scanf("%d",&n);
	do
	{
		scanf("%d",&m[i]);
		i++;
	}while(i<=n);
	if(n==1)
	{printf("%d",m[1]);}
	else
	{
		printf("%d",m[1]);
		do
		{
			b=1;
			do
			{ 
				num=0;
				if(m[b]==m[a]){num++;break;}
				else{b++;}
			}while(b<a);
			if(num==0){printf(" %d",m[a]);}
			else{}
			a++;
		}while(a<=n);
	}
	return 0;
}
int main()
{
	int n;
	int a[91];
	int i;
	for( i=0 ; i<91 ; i++ )
	{
		a[i]=0;
	}
	cin>>n;
	cin>>i;
	cout<<i;
	a[i-10]=1;
	while( n>0 )
	{
		n--;
		int b;
		cin>>b;
		if( a[b-10]==0 )
		{
			cout<<' '<<b;
			a[b-10]=1;
		}
	}
}
int main ()
{
	int n, x, count[91] = {0};
	cin >> n;
	cin >> x;
    cout << x;
	count[x - 10]++;
	for (int i = 1; i <= n - 1; i++)
	{
		cin >> x;
		if (count[x - 10] == 0)
			cout << " " << x;
		count[x - 10]++;
	}
	return 0;
}
/*
 * 1000012730_26.cpp
 *  ????????
 *  Created on: 2010-10-29
 *      Author: ???
 */

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

	}

}
}
int main(){
 int n,i,j,k=1,a[20001],b[20001],f;
 scanf("%d",&n);
 for(i=0;i<n;i++){
     scanf("%d",&a[i]);
     if(i==0) b[0]=a[0];
     f=1;
     for(j=0;j<i;j++){
            if(a[i]==a[j]){
                f=0;
                break;
                }            
            }
     if(f==1){ 
        b[k]=a[i];k++;  
    } 
        } 
    
    for(i=1;i<k-1;i++){
        printf("%d ",b[i]);
        }
    printf("%d",b[k-1]);
    scanf("%d",&n);
    return 0;
    }
/*
 * print different numbers.cpp
 *
 *  Created on: 2013-10-28
 *      Author: kongwei
 */
int main()
{
	int n;
	cin>>n;
	int array[n];//????
	for(int i=0;i<=n-1;i++)//????
		cin>>array[i];
	cout<<array[0];//???array[0]
	for(int i=1;i<=n-1;i++)//??????????
	{
		int g=0;//?????g,?????0
		for(int j=0;j<=i-1;j++)//???????????????????????
			if(array[i]==array[j])
				g=g+1;
		if(g==0)
			cout<<" "<<array[i];
	}
	return 0;
}
int main()
{
	int a[20000],t,j,m,i,asd;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{t=1;
	scanf("%d",&a[i]);
	if(i==0)
	{printf("%d",a[i]);}
	else if(i!=0)
	{
	for(j=0;j<i;j++)
    {asd=a[i]-a[j];
	if(asd==0)
	{t=0;
	break;}
	}if(t==1)
		printf(" %d",a[i]);
	
	}
	}
	
	printf("\n");
	return 0;
	}
int main(){
	      int a[20000],n,i,j;
	      cin>>n;
	      for(i=0;i<n;i++){
	    	  cin>>a[i];
	    	  for(j=0;j<i;j++)
	    	  {
	    		  if(a[j]==a[i]) a[i]=0;
	    	  }
	      }
	      cout<<a[0];
	      for(i=1;i<n;i++) if(a[i]!=0) cout<<" "<<a[i];
	      return 0;
}
int main()
{
  int a[10000],n,i,t,j,m;
  scanf("%d/n",&n);
  for(i=0;i<n;i++)
   scanf("%d",&a[i]);
  printf("%d",a[0]);
  for (i=1;i<=n-1;i++)
    {
    m=0;                  
    for(j=0;j<=i-1;j++)
      if(a[i]==a[j]) m=m+1;
    if(m==0) printf(" %d",a[i]);
     }
    return 0;
}
int main()
{
	int n,a,i,j;
	while(cin>>n)
	{
		char b[20000];
		int a[20000];//????
		for(i=0;i<n;i++)
			cin>>a[i];
		cin.getline(b,20000);//??????????????????????????????????//
		cout<<a[0];
		for(i=1;i<n;i++)
		{
			for(j=0;j<i;j++)//????????????
				if(a[i]==a[j])break;//????????????
			if(j==i)
				cout<<" "<<a[i];
		}
		cout<<endl;

	}
	return 0;}
int main()
{
	int n, m, num[20000], i, num_cout[20000], k, j;
	cin >> n;
    for (i = 0; i < n; i++)
	{
		cin >> num[i];
	}
	num_cout[0] = num[0];
	k = 1;
	for (i = 1; i < n; i++)
	{
		m = 0;
		for (j = 0; j < k; j++)
		{
			if (num[i] == num_cout[j])
				m++;
		}
		if (m == 0)
		{
			num_cout[k] = num[i];
			k++;
		}
	}
	for (i = 0; i < k - 1; i++)
	{
		cout << num_cout[i] << " ";
	}
	cout << num_cout[k - 1];
	return 0;
}
int main()
{
	int A[20000],B[20000],n,i,j,k;
	int flag;
	int number=0;
	j=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&A[i]);
	}
	for(i=0;i<n;i++)
	{
		flag=0;
		for(k=0;k<i;k++)
		{
			if(A[k]==A[i])
			{
				flag=1;
				break;
			}
		}
		if(flag==0)
		{
			B[j]=A[i];
			number=number+1;
			j=j+1;
		}
	}
	for(j=0;j<number;j++)
	{
		if(j==0)
		{
			printf("%d",B[j]);
		}
		else 
		{
			printf(" %d",B[j]);
		}
	}
	return 0;
}
main()
{
 int n;
 scanf("%d",&n);
 int*p;
 p=(int*)malloc(n*sizeof(int));
 int i,j;
 for(i=0;i<n;i++)
 scanf("%d",&p[i]); 
 printf("%d",p[0]); 
 for(i=1;i<n;i++)  
 {
  for(j=0;j<i;j++)
  {
   if(p[i]==p[j])
   break;
  }
  if(j==i)
  printf(" %d",p[i]);
 } 
 getchar();
 getchar();
 getchar();
 getchar();
 getchar();
 getchar();
}
int main()
{
	int a[20000],b[20000];
	int n,i,j,k=0;
	scanf("%d",&n);
	for (i=0;i<n;i++)
		scanf("%d",&a[i]);
	for (i=n-1;i>0;i--)
	{
		for (j=0;j<i;j++)
		{
			if (a[i]==a[j])
				break;
			if (j==i-1)
			{
				b[k]=a[i];
				k++;
			}
		}
	}
	b[k]=a[0];
	for (i=k;i>0;i--)
		printf("%d ",b[i]);
	printf("%d",b[0]);
	return 0;
}
void main()
{
	int a[20000],b[20000];
	int n,i,k,j,l,m,bn;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
    b[0]=a[0];
	m=0;
    for(j=1;j<n;j++)
	{
		for(k=0,l=1;k<j;k++)
		{
			if(a[j]==a[k])
			{ 
				l=0;
				break;
			}
		}
	    if(l!=0)
		{
			m+=1;
			b[m]=a[j];
		}
	}
	for(bn=0;bn<m;bn++)
	{
		printf("%d ",b[bn]);
	}
    printf("%d",b[m]);
}
int main()
{
    int n,i,k;
    scanf("%d",&n);
    int a[100]={0};
    scanf("%d",&k);
    a[k]=a[k]+1;
    printf("%d",k);
   for(i=2;i<=n;i++)
   {
     scanf("%d",&k);
     a[k]=a[k]+1;
     if(a[k]==1)
     printf(" %d",k);
    }
     return 0;
}
int main()
 {
  int n,i,j;
  scanf("%d",&n);
  int a[n];
  for (i=0;i<n;i++)
  scanf("%d",&a[i]);
  i=0;
  while (i<n)
  { for (j=i+1;j<n;j++)
   if (a[i]==a[j]) a[j]=0;
   i++;}
  printf("%d",a[0]);
  i=1;
  for (i=1;i<n;i++)
  if (a[i]!=0) printf(" %d",a[i]);
}
int main(){
	int n,a[20001],i,j;
	cin >> n;
	for(i=0;i<n;i++){    //??????
		cin >> 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;      //????????0
		}
	}
	int temp[20001],k=0;
	for(i=0;i<n;i++){
		if(a[i]!=0){
			temp[k]=a[i];         //?temp??????????????
			k++;
		}
	}
	for(i=0;i<k-1;i++) cout << temp[i] << ' ';   //?????????
	cout << temp[k-1]<< endl;
	return 0;
}
int main()
{
    int n, a[30000], i, j, hash[30000];
    cin>>n;
    for( i = 1; i <= n; i++ )
      {
        cin>>a[i];
        hash[i]=1; 
      }
    cout<<a[1];
    for( i = 2; i <= n; i++ )
      {
           
        for(j=1; j<i ; j++)
          {
            if(a[i]==a[j])
              {
                hash[i]=hash[i]*0;
              }
            else
              {
                hash[i]=hash[i];
                
              }   
          }
      }
    for( i = 2; i <= n; i++ )
      {
        if(hash[i]==1)
        cout<<" "<<a[i];   
      }
    int b;cin>>b;
    return 0;  
    
    }
/*
 * ????shuzu.cpp
 * ???00948343_??
 * ?????2012/10/8
 * ???????????
 */



int main(){
	int n;                     //???????
	cin >> n;
	int a[n], i, j;            //?????????
	for (i=0;i<n;i++){
		cin >> a[i];           //????
		for (j=0;j<i;j++){     //????????
			if (a[j]==a[i])
				break;
		}
		if (j==i){             //????????????????
			if (i!=0)
				cout << ' ';
			cout << a[i];
		}
	}
	return 0;
}
int main(){
	int n,i,k,t;
	cin>>n;
	int a[n];
	for(i=0;i<n;i++)
		cin>>a[i];
	for(i=0;i<n;i++)
		for(k=i+1;k<n;k++)
		 while ((a[k]==a[i])&&(k<n)) //?a?i???????????
		  {for(t=k;t<n-1;t++)        //???????
		  a[t]=a[t+1];
		  n--;}
	for(i=0;i<n-1;i++)
		cout<<a[i]<<" ";
	cout<<a[n-1];
	return 0;

}
int main()
{
	int n, i, j;
	int a[100000];
	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;
				
		}
	}
	printf("%d", a[0]);
	for (i=1;i<n;i++)
	{
		if (a[i]!=0)
		printf(" %d", a[i]);
	}

}
void main()
{
 int k,m,i,j,n;
 int s1[20000],s2[20000];
 scanf("%d",&n);
 for(i=0;i<n;i++)
 scanf("%d",&s1[i]);
 for(i=n-1,m=0;i>=0;i--)
 {k=0;
  for(j=i-1;j>=0;j--)
  {if(s1[i]==s1[j])
   k++;}
  if(k==0)
  {s2[m]=s1[i];
   m++;}
}
  s2[m]='\0';
for(n=m-1;n>0;n--)
{printf("%d ",s2[n]);
 }
printf("%d",s2[0]);
}
//??n????n???????????????10-100??? 
//???????????????????????????????????????????
//???2010?10?25
int main()
{
	int n, b[91]={0}, i, k,counter=0, temp;//n:?????????????,temp:?????????b[90],??90???????????????10-100; i k??????;counter???
	cin>>n;
	for (i=1; i<=n; i++)//n???????
	{
		cin>>temp;
		for (k=0; k<91; k++)//????????????
		{
			if (b[k]==temp )//????????
				break;
		}
		if(k>=91)//????????????,???????????
		{
			b[counter]=temp;
			counter++;//????,??1,?????counter-1??
		}
	}
	for (k=0; k < counter-1; k++)//??????
	{
		cout<<b[k]<<" ";
	}
	cout<<b[counter-1]<<endl;//????,?????
	return 0;
}
//***************************************************************
//*????????????                                     *
//*?  ?????                                               *
//*?????2010.10.29.                                        *
//*?????????????                                   *
//***************************************************************
int main ()
{
	int i, n;                          //i?????????????n????????
	cin>>n;
	int a[20000] = {0};                //????????20000????????0
	for ( i = 0; i < n; i ++ )
	{
		cin>>a[i];                     //????????
	}
	cout<<a[0];                        //???????

	int k, m;                          //??????k,m
	for ( k = 1; k < n; k ++ )
	{
		for ( m = 0; m < k; m ++ )     //???????????????
		{
			if ( a[k] != a[m] )
				continue;
			else
				break;
		}
		if ( m == k && a[k] != a[k-1] )    //??????????????????????
			cout<<" "<<a[k];               //??????? 
	}
	return 0;
}
int main()
{
	int n,a[20000]={'\0'},i=0,j=0,k=0,temp,count;
	scanf("%d",&n);
	scanf("%d",&a[0]);
	printf("%d",a[0]);
	for(i=1;i<=n-1;i++)
	{
		scanf("%d",&temp);
		count=0;
		for(j=0;j<=k;j++)
		{
			if(temp==a[j])
				break;
			else
				count++;
		}
		if(count==k+1)
		{
			k++;
			a[k]=temp;
		}
	}
	for(i=1;a[i]!='\0';i++)
		printf(" %d",a[i]);
}
void main()
{
	int m,n,a[20000],i,j;
	j=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	printf("%d",a[0]);
	m=1;
	if(n>1)
	{
		do
		{

			for(i=m-1;i>=0;i--)
			{
				if(a[m]==a[i])
					j=j+1;
			}
			if(j==0)
				printf(" %d",a[m]);
			j=0;
			m=m+1;
		}while(m<n);
	}
	printf("\n");
}
int main()
{
	int n, i, j, num[20000] , st[91] , tot=0 ;
    scanf("%d",&n);
    for(i=0;i<n;i++)scanf("%d",&num[i]);
	for( i=0 ; i<n ; i++ )
	{
	  for( j=0 ; j<i ; j++ ) if(num[j]==num[i])break;
	  
	  if( j==i ) st[++tot]=num[i];
	}
	for( i=1 ; i<tot ; i++ ) printf("%d ",st[i]);
	printf("%d",st[tot]);
}
int main()
{
	int n=0,x=0,a[100]={0},i=0;
	cin>>n;
	cin>>x;
	cout<<x;
	a[x-1]=1;
	for(i=2;i<=n;i++)
	{
		cin>>x;
		if(a[x-1]==0)
		{
			cout<<" "<<x;
			a[x-1]=1;
		}
	}
	return 0;
}
int check(int b[],int len,int x)
{
	int i,flag=1;
	for(i=0;i<len;i++)
	{
		if(b[i]==x)
		{
			flag=0;
			return 0;
			break;
		}
	}
	if(flag)
		return 1;
}
int main()
{
	int j,i,n;
	int a[20100],b[20100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	printf("%d",a[0]);
	b[0]=a[0];
	j=1;
	for(i=1;i<n;i++)
	{
		if(check(b,j,a[i]))
		{
			printf(" %d",a[i]);
			b[j]=a[i];
			j++;
		}
	}

	return 0;
}
int main()
{
	int n,m[10000],i,j,x[10000],z=0,h=1;
	scanf("%d\n",&n);
	for(i=1;i<=n;i++)
		scanf("%d",&x[i-1]);
	m[0]=x[0];
	for(i=2;i<=n;i++)
	   {z=0;
		for(j=1;j<=i-1;j++)
	       if(x[j-1]==x[i-1])
			   z=1;
	    if(z==0) {m[h]=x[i-1];
		             h=h+1;}
	   }
	for(i=0;i<=h-1;i++)
	{printf("%d",m[i]);
	if(i!=h-1) printf(" ");}

	return 0;
	
}
void main()
{
	int n,i,j,k,a[20001];
	scanf("%d\n",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		for(j=0;j<i;j++)
			if(a[i]==a[j]){
				a[i]=0;
				break;
			}
	}
	for(k=0;k<n;k++){
		if(a[k]){
			if(!k)
				printf("%d",a[k]);
			else
				printf(" %d",a[k]);
		}
	}
}
int main()
{
	int n,i=0,x,m=0,k=0,t=0;
	cin>>n;
	int shuzu[n];
	for(i=0;i<n;i++)
	{
		cin>>x;
		shuzu[i]=x;
	}
	for(m=0;m<n;m++)
	{
		if(m==0){cout<<shuzu[m];}
		else
		{
			for(k=0;k<m;k++)
			{
				if (shuzu[m]!=shuzu[k]) t=1;
				else {t=0;break;}
			}
			if(t==1) cout<<" "<<shuzu[m];

		}

	}


	return 0;
}