semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(){
	int n;
	int *number;
	int i,j;
	int sum;

	scanf("%d",&n);
	number=(int*)malloc(sizeof(int)*n);
	for(i=0;i<n;i++){
		scanf("%d",&number[i]);
	}

	i=0;
	while((i<n)&&(sum!=0)){
	    if((i==n-1)&&(number[i]!=0)){
			printf("%d",number[i]);
		}
		sum=0;
		for(j=i+1;j<n;j++){
			if(number[j]==number[i]){
				*(number+j)=0;
			}
			sum+=number[j];
		}
		
		if((sum!=0)&&(number[i]!=0)){
			printf("%d ",number[i]);
		}
		else if ((sum==0)&&(number[n-1]==0)){
			printf("%d",number[i]);
			sum=0;
		}
		i++;

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

	return 0;
}
int main()
{
    int n,i;
    cin >> n;
    int x[n+1];
    x[0]=0;
    for (i=1;i<=n;i++)
    {
        int a;
        cin >> a;
        x[i]=a;
    }
    int j;
    for (j=n;j>1;j--)
    {
        int k;
        for (k=1;k<j;k++)
        {
            if (x[k]==x[j])
            {
                           x[j]=0;
            }
        }
    }
    cout << x[1];
    for (i=2;i<=n;i++)
    {
        if (x[i]!=0)
        {
                    cout << " " << x[i];
        }
    }
    cout << endl;
    
    return 0;
}
int main()
{
 int n,i,j;
 int k=1;
 int a[20000];
 scanf("%d",&n);
 for(i=1;i<=n;i++)
   {
    scanf("%d",&a[i-1]);
     for(j=0;j<=i-1;j++)
      {
       if(i-1==0) {k=k+1; a[0]=a[0];}
             else {
                   if(a[j]==a[i-1]&&j!=i-1) break;
                         else if(a[j]==a[i-1]) {a[k-1]=a[i-1]; k=k+1;}
                  }
      }
    }
   for(i=0;i<=k-3;i++) printf("%d ",a[i]);
   printf("%d",a[k-2]);
 return 0;
}
int main() {
	int n;
	scanf("%d", &n);
	int number[NUMBER];
	int i;
	i=0;
	while(i<n)
	{
		scanf("%d", &number[i]);
		i++;
	}
	i=1;
	int j=0;
	printf("%d", number[0]);
	while(i<n)
	{
		while(j<i)
		{
		   if(number[i]==number[j])
		   {
			    break;
		   }
		   else
		   {
			   j++;
		   }
		   if(j==i)
		   {
			   printf(" %d", number[i]);
		   }
		}
		j=0;
		i++;
	}
	return 0;
}
void main()
{
 int a[20000],b[20000],i,j,k=0,flag,n;
 scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
 for(i=0;i<=n-1;i++)
 {
  flag=1;
  for(j=0;j<=i-1;j++)
   if(b[j]==a[i])
   {
    flag=0;
    break;
   }
  if(flag)
  {
   b[k]=a[i];
   k++;
  }
 }
 for(i=0;i<=k-2;i++)
  printf("%d ",b[i]);
  printf("%d",b[k-1]);
}
main()
{
      int a[101]={0};
      int n,i,now,sign;
      
      scanf("%d",&n);
      sign=0;
      for (i=1;i<=n;i++)
      {
          scanf("%d",&now);
          if (a[now]==0)
          {
              a[now]=1;
              if (sign==1)
                  printf(" ");
              else
                  sign=1;
              printf("%d",now);
          }
      } 
      printf("\n");;
      return 0;      
}
/*
 * my project5.cpp
 *
 *  Created on: 2010-11-5
 *      Author: Administrator
 */
int main()
{
	int n,i,j,k,t=0;
	cin>>n;
	//cout<<endl;
	int a[n];
	for(i=0;i<n;i++){
	cin>>a[i];
	}
	/*
    for(i=0;i<n-t;i++){
    	for(j=i+1;j<n-t;j++){
    		if(a[j]==a[i]){
              t++;
              for(k=j;k<n-1;k++){
    		 a[k]=a[k+1];
            }
              j--;

            }

            }

            }

    i=n-t;

    for(i=0;i<n-t-1;i++)
    	cout<<a[i]<<" ";
   cout<<a[n-t-1]<<endl;*/

	for (i=0; i<n; i++ )
		if (a[i]>=0)
			for (j=i+1; j<n; j++ )
				if (a[i]==a[j]) a[j]=-1;
	for (i=0; i<n; i++ )
		if (a[i]>=0)
		{
			if (i>0) cout<<' ';
			cout<<a[i];
		}
	cout<<endl;
	return 0;
}
int main()
{int a[20002]={1},n,i,j,k;
scanf("%d",&n);
scanf("%d",&a[1]);
printf("%d",a[1]);
 for(i=2;i<=n;i++)
 { scanf("%d",&a[i]);
    k=0;
   for(j=i-1;j>0;j--)
   {if (a[i]==a[j])break;
   else k=k+1;}
    if(k==i-1)printf(" %d",a[i]);
 }
   
 
 return 0;
}
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 k = 0 ; k < i ; k ++ )
		{
			if( a[i] == a[k] ) break ;
			if( k == i - 1 ) cout << " " << a[i] ;
		}
	}
	cout << endl ;
	return 0 ;
}
int main()
{
	int n,i,j,a[100001],b[100001],temp=1; //temp??????b[100001]??????? 
	cin>>n;
	for (i=0;i<n;i++)
	{
		cin>>a[i];
		b[0]=a[0];	
		for (j=0;j<i;j++)
		{
			if (a[i]==a[j]) break;     //?????????????? 
			if (j==i-1)               //???????? 
			{
				b[temp]=a[i];
				temp++;	
			}	
		}	
	}
	for (i=0;i<temp-1;i++)
	{
		cout<<b[i]<<" ";	
	}
	cout<<b[temp-1];
	return 0;	
}
int n;
int a[20000]={0},b[20000]={0};
int main()
{
    int i,j,k=0,g=0,kk=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[i]==a[j])
                                      {
                                                    a[j]=-1;
                                      }
                    }
    }
    for(i=0;i<n;++i)
    {
                    if(a[i]>=0)
                    {
                               b[k]=a[i];
                               ++k;
                    }
    }
    for(i=0;i<k-1;++i)
    {
                      cout<<b[i]<<" ";
    }
    cout<<b[k-1]<<endl;
    /*
    b[0]=a[0];
    cout<<a[0]<<" ";
    for(i=0;i<n-1;++i)
    {
                    kk=0;
                    //cout<<" ";
                    for(j=0;j<=k;++j)
                    {
                                    if(a[i]==b[j])
                                    {
                                                  kk=1;
                                    }
                    }
                    if(kk) continue;
                    cout<<a[i]<<" ";
                    ++k;
                    b[k]=a[i];
    }
    for(i=0;i<k;++i)
    {
                    if(a[n-1]==b[j]) g=1;
    }
    if(!g) cout<<a[n-1];
    cout<<endl;
    */
    //int stop;
    //cin>>stop;
    return 0;
}
//****************************************
//*???????????                      
//*?????? 1100012789      
//*???2011.12.11                       
//****************************************

int main()
{
	int flag[100] = {0}, i, n, temp;
	cin >> n;
	cin >> temp;
	flag[temp] = 1;
	cout << temp;
	for (i = 1; i < n; i++)
	{
		cin >> temp;
		if (flag[temp] == 0)
		{
			cout << " " << temp;
			flag[temp] = 1;
		}
	}
	return 0;
}
void main()
{
	int h,i,d,j;
	int a[20001];
	scanf("%d",&h);
	for(i=1;i<=h;i++)
		scanf("%d",&a[i]);
	printf("%d",a[1]);
	for(i=2;i<=h;i++)
	{
		d=0;
		for(j=1;j<i;j++)
		{
			if(a[i]==a[j])
			{
				d=1;
				break;
			}
		}
		if(d==0)
			printf(" %d",a[i]);
	}
}
int main ()
{
	int n, i, k = 0, num;
	int a[100] = {0}, b[100];
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> num;
		if(a[num] == 0)
		{
			a[num] ++;
			b[k] = num;
			k++;
		}
	}
	for (i = 0; i < k - 1; i++)
		cout << b[i] << " ";
	cout << b[k - 1];
	return 0;
}
void main()
{
	int n,*p;
	scanf("%d",&n);
	p=(int *)malloc(sizeof(int)*n);
	int i,j;
	for(i=0;i<n;i++)
	{
		scanf("%d",p+i);
	}
	printf("%d",*p);
	for(i=1;i<n;i++)
	{
		for(j=0;j<i;)
		{
			if(*(p+i)==*(p+j))
				break;
			else
				j++;
		}
		if(j==i)
			printf(" %d",*(p+i));
	}
}
int main(){
	int n,a[20000],i,j,h=0,k;
	scanf("%d",&n);
	for(i=0;i<n;i=i+1){
		scanf("%d",&a[i]);
	}
	printf("%d",a[0]);
	for(j=1;j<n;j=j+1){
		for(k=0;k<j;k=k+1){
			if(a[j]==a[k]) {h=1;}
		}
		if(h==0){printf(" %d",a[j]);}
	
		else{h=0;}
 

	}







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

printf("%d",q[0]);
for(i=1;(i<n);i++)
{c=0;
for(j=0;j<i;j++)
{if(q[j]==q[i])
 c++;
 else 
 c=c+0;}

   if(c==0)
   printf(" %d",q[i]);
   else
   f++;}
}
//*****************************
//????????????    *
//?????????          *
//??????                *
//??:2010.10.29             *
//*****************************


int main()
{
	int n,j = 0 , m = 0;
	cin>>n;
	int a[100000];
	int b[100000];
	for(int k =0 ; k < n ; k++ )
	{
		cin>>a[k];
	}
	for(int i = 0 ; i<n ; i++)
	{
		int count= 0;
		for(int l = 0 ; l<i ; l++)
		{
			if(a[l]==a[i])
			{
				count = 1 ;
				m = m + 1 ;
				break;
			}
			
		}
		if(!count)
		{
			b[j] = a[i] ;
		    j++;
		} 
	}
	for(int h = 0 ; h<(n-m) ; h++)
	{
		if(h==0)
			cout<<b[h];
		if(h>0)
			cout<<" "<<b[h] ;
	}
	return 0;
}
/*
 * 1000010548-25.cpp
 *??: 2010-10-31
 *??: ??
 *???????????
 */
int main(){//?????
	int n,i,j,k,t;//??????
	cin>>n;//??n
	int a[20000];//??????
	for(i=0;i<n;i++)//??????
		cin>>a[i];//????????
	cout<<a[0];//????????
	for(j=1;j<n;j++){//??????
		for(k=0;k<j;k++)//??????
			if(a[j]==a[k])//???????
				break;//????
		if(k==j)//??????????
		   cout<<" "<<a[j];//????
	}
	return 0;//?????
}
int main()
{
	int n, i, j, m;
	int a[20000];
	scanf("%d\n", &n);
	for(i=1;i<=n;i++)
	{
		scanf("%d ", &a[i-1]);
	}
	printf("%d", a[0]);
	for(j=2;j<=n;j++)
	{
		for(m=1;m<=j-1;m++)
		{
		    if(a[j-1]==a[m-1]) 
			{
				break;
			}
		}
		if(m==j) printf(" %d", a[j-1]);
	}
	return 0;
}
int main()
{
	int n,i,a[20000],j,k,b=0,c[20000];
	scanf("%d", &n);
	for (i = 0; i <= n - 1; i++)
	{
		scanf("%d", &a[i]);
	}
	printf("%d", a[0]);
	for (i = 1; i <= n - 1; i++)
	{
		k = 0;
		for (j = 0; j <= i-1; j++)
		{
			if (a[i] == a[j]){ k = 1; }
		}
		if (k == 0){ printf(" %d", a[i]); }
	}
	printf("\n");
}
int main()
{
int n,a[20000],i,j,f;

scanf("%d%d",&n,a);
printf("%d",*a);
for(i=1;i<n;i++)
{
  f=0;
  scanf("%d",a+i);
  for(j=0;j<i;j++)
  {
   if(*(a+i)==*(a+j))
   f=1; 
  }
if(f==0)
printf(" %d",*(a+i));
else continue;
}
return 0;
}
void 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]);
	if(n>=2)
	{
		if(a[1]!=a[0])
		printf(" %d",a[1]);
	     for(i=2;i<n;i++)
		 {
		   if(a[i]!=a[0])
		   {
			   for(j=0;j<i-1;j++)
			   {
			   if(a[j]!=a[i])
				continue;
			   else
				break;
			   }
		       if(a[j]!=a[i])
			printf(" %d",a[i]);
		   }
		   else
			continue;
		 }
	}
}
//????????   ???  ??1000012729
//****************************************************************
int main()
{
	int i,j,n,num[20000],judge;           //????num,?????
	                                      //???judge
	cin>>n;
	cout<<endl;
	if(n>0 && n<=20000)                    //??n??0??20000
	{
		for(i=0;i<n;i++)
		{
			judge=0;
			cin>>judge;
			if(judge>=10 && judge<100)     //??????
				                           //????10??100
			{
				num[i]=judge;
			}
		}
		for(i=1;i<n;i++)
		  for(j=0;j<i;j++)
		  {
			  if(num[i]-num[j]==0)        //??????????
				                          //????
				  num[i]=0;               //???????????0
		  }
		  cout<<num[0];
		  for(i=1;i<n;i++)
		{
			if(num[i]!=0)                 //????0??
				cout<<" "<<num[i];
		}
	}	 
	else
	{
		cout<<"error"<<endl;
	}
	return 0;
}
int main()
{
int a[20000];
int n,i,j,p;
scanf("%d",&n);
for (i=1;i<=n;i++)
{
scanf("%d",&a[i]);
p=0;
for (j=1;j<i;j++)
{
if (a[j]==a[i])
{
p=1;
}
}
if (p==0 & i==1)
{
printf("%d",a[i]);
}
if (p==0 & i!=1)
{
printf(" %d",a[i]);
}
}
return 0;
}
int main() {
	int n;
	cin>>n;
	int a[n];
	int num=0;
	int c=1;
	int j,i;
	int b[100];
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(i=0;i<n;i++)


	{  for(j=0;j<i;j++)
		 {if (a[i]==a[j])
			 c=0;}

		 if(c!=0)
		 {
			 num=num+1;
	        b[num]=a[i];

	      }
		 c=1;
	}

	for(i=1;i<num;i++)
	{
      cout<<b[i]<<" ";

	}
	cout<<b[num];









	return 0;
}
int main()
{
   int a[100];
   for (int i=2;i<=100;i++)
   {
	   a[i]=0;
   }
   int n;
   cin>>n;
   int b;
   cin>>b;
   cout<<b;
   a[b]=1;
   for (int i=2;i<=n;i++)
   {
	   //int b;
	   cin>>b;
	   if (a[b]==0)
	   {
		   a[b]=1;
		   cout<<' '<<b;
	   }
   }
}
int main()
{
	int n,i,j;
	scanf("%d\n",&n);
	int num[n];
	scanf("%d",&num[0]);
	printf("%d",num[0]);
	for(i=1;i<=n-1;i++)
	{
		scanf(" %d",&num[i]);
		for(j=0;j<=i;j++)
		{
		if(j<i&&num[j]==num[i])
		{break;}
		if(j==i)
		{printf(" %d",num[i]);}
		}
	}
return 0;	
}
int main()
{
	int a[100];
	int i,n,number,count,countl;
	count=0;
	countl=0;
	for(i=0;i<100;i++)
	{
		a[i]=0;
	}
	scanf("%d",&n);
	int b[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&number);
		if(a[number]==0)
		{
			a[number]=1;
		
			b[count]=number;
				count=count+1;
		}		
	}
	for(i=0;i<count;i++)
	{
			countl=countl+1;
			printf("%d",b[i]);
			if(countl<count)
			{
				printf(" ");
			}
		
	}

	return 0;
}
int main()
{
    int i,j,n,k;
    int a[10000];
    scanf("%d\n",&n);
    for(i=0;i<n;i++)
    {
                    scanf("%d",&a[i]);
                    if(i==0)
                    printf("%d",a[i]);
                    else
                    {
                     k=0;
                    for(j=0;j<i;j++)
                    {
                                    if(a[i]==a[j])
                                    {
                                                  k=1;
                                    }
                    }
                    if(k==0)
                    printf(" %d",a[i]); 
                    }
    }
    return 0;
}
int main()
{
	int n, a[20000], i, j, k;
	cin >> n;
	for (i = 0; i < n ; i++)
		cin >> a[i];
	for (i = n - 1; i > 0; i--)
	{
        for (j = 0; j < i; j++)
		{
			if (a[i] == a[j])
			{
				for (k = i ; k < n; k++)
				{
					a[k] = a[k + 1];
				}
				n = n - 1;
			}
		}
	}
	for (i = 0; i <= n - 1; i++)
	{
		cout << a[i];
		if (i != n - 1)                        
			cout << " ";
	}
    return 0;
}
int main()
{
	int n,i,j,q,x=1;
	int shuzu[N],panduan[N];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&(shuzu[i]));
	}
	panduan[0]=0;
	for(i=1;i<n;i++)
	{
		for(q=0,j=0;j<i;j++)
		{
			if(shuzu[j]==shuzu[i])
			{
				q=1;
				break;
				
			}
		}

		panduan[i]=q;
	}
	for(i=0,x=0;i<n;i++)
	{
		if(panduan[i]==0)
		{
			x=x+1;
		}
	}
	for(i=0;i<n;i++)
	{
		if(panduan[i]==0&&(x!=1))
		{
			printf("%d ",shuzu[i]);
			x--;
		}
		else if(panduan[i]==0&&(x==1))
		{
			printf("%d",shuzu[i]);
			x--;
		}


	}

	return 0;
}
int main()
{
int n,a[200000],i,j,b,c[101];
scanf("%d",&n);
for(i=0;i<101;i++){
	c[i]=0;
}

for(i=0;i<n;i++){
	scanf("%d",&a[i]);
	c[a[i]]++;
	if(c[a[i]]==1){
		if(i==0)printf("%d",a[0]);
		else printf(" %d",a[i]);
	}
}

return 0;
}
int main()
{
	int n, i, t, a[20000], b[100], c[20000];
	cin >> n;
	for (i = 0; i < 100; i++)
		b[i] = 1;
	for (i = 0; i < n; i++)
		cin >> a[i];
	t = 0;
	for (i = 0; i < n; i++)
		if (b[a[i]] == 1)
		{
			c[t] = a[i];
			t++;
			b[a[i]] = 0;
		}
	for (i = 0; i < t - 1; i++)
		cout << c[i] << " ";
	cout << c [t - 1] << endl;
	return 0;
}
int main()
{
	int n; 
	cin>>n;
	int zz[20000];
	int i,j;
	for ( i = 0 ; i < n ; i ++ )
		cin>>zz[i];
	for ( i = 0 ; i < n ; i ++ )
	{
		for ( j = i + 1 ; j < n ; j ++ )
		{
			if ( zz[i] == zz[j] )
			{
				zz[j] -= zz[i];
			}
		}
	}
	cout<<zz[0];
	for ( i = 1 ; i < n ; i ++ )
	{
		if ( zz[i] != 0)
			cout<<" "<<zz[i];
	}
}
//10?28?????????????????1000012899
int main()
  { 
    int n, a[20001], b[20001], i, m;
    cin >> n;
    m = n;
    for (i = 1; i <= n; i ++) b[i] = 0;
    for (i = 1; i <= n; i ++) 
      {
          cin >> a[i];
          b[a[i]] = 1;
       }
    i = 2;
    cout << a[1];
    b[a[1]] = 0;
      do
      {
        if ( b[a[i]] == 1) 
          {
             cout << ' ' << a[i] ;
             b[a[i]] = 0;
           }
        m = m - 1;
        i = i + 1;
       }
         while(m >= 0);
  /*   do
      {
        if ( b[a[i]] == 1) 
          {
             cout << a[i];
             b[a[i]] = 0;
           }
        m = m - 1;
        i = i + 1;
       }
         while(m > 0); */
   return 0;
  }
int main()
{
    int n,i,j,x,a[20000]={0},b[20000]={0};
    scanf("%d\n",&n);
    for(i=0;i<n;i++)
         scanf("%d ",&a[i]);
    b[0]=a[0];
    for(j=1;j<=n;j++)
    {
                     x=0;
                     for(i=0;i<j;i++)
                     {
                                     if(a[j]==a[i])
                                     x++;
                     } 
                     if(x==0)
                     b[j]=a[j];
                     else b[j]=0;
    }
    printf("%d",b[0]); 
    for(i=1;i<n;i++)
    {
                     if(b[i]!= 0)
                     printf(" %d",b[i]);
    }    
    getchar();
    getchar();
}
//
//  main.cpp
//  hw
//
//  Created by ? ? on 12-12-13.
//  Copyright (c) 2012? ? ?. All rights reserved.
//

int main()
{
    int n,figure[20000]={0},num[100]={0},flag[100]={0};
    cin>>n;
    for (int i=0; i<n; i++) {
        cin>>figure[i];
    }
    flag[figure[0]]++;
    cout<<figure[0];
    for (int i=1; i<n; i++) {
        if (flag[figure[i]]==0) {
            flag[figure[i]]++;
            cout<<" "<<figure[i];
            continue;
        }
    }
    return 0;
}
int main(){
   int n,i,j,k;
   k=0;
   scanf("%d",&n);
   int a[n],b[n];
   for(i=0;i<n;i++){
      scanf("%d",&a[i]);
      }
   for(j=0;j<n-1;j++){
      if(a[j]!=100){
      for(i=j+1;i<n;i++){
          if(a[i]==a[j]){
            a[i]=100;
            }
            }
            }
            }
   printf("%d",a[0]);
   for(i=1;i<n;i++){
      if(a[i]!=100){
        printf(" %d",a[i]);
        }
        }
   scanf("%d",&n);
   return 0;
}
int main()
{
	int n,i,j,l;
    int *m;
    scanf("%d",&n);
	m=(int*)malloc(sizeof(int)*n);
    for(i=0;i<n;i++)
	{
		scanf("%d",m+i);
	}
	printf("%d",*m);
	for(i=1;i<n;i++)
	{
		l=0;
		for(j=0;j<i;j++)
		{  
		   if(*(m+i)==*(m+j))
		   {
			   l=1;
			   break;
		   }
		}
        if(l==0)
		   {
              printf(" %d",*(m+i));
		   }
	}
	free(m);
	return 0;
}
int main ()
{
	   int a,b,j,i,leap=0,f=1;
	   int m[20000];
	   scanf("%d",&a);
       for(i=0;i<a;i++)
		   scanf("%d",&m[i]);
	  for(i=0;i<a;i++)
	 {	  leap=0;
	   
	  for(j=0;j<i+1;j++)
	  {if(j==i)
			continue;
		else 
		{if (m[i]==m[j])
		{ leap=1;
                break;}
		}
	  }
	 if(leap==0&&f==1)
	 {printf("%d",m[i]);
	  f=0;
	 continue;
	 }
	 if(leap==0&&f==0)
	  printf(" %d",m[i]);
	  }
	return 0;
}
int main()
{
	int n, a[20000], i, b[101] = {0}, flag = 0;
	cin >> n;
	for(i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	for(i = 0; i < n; i++)
	{
		if(b[a[i]] == 0)
		{
			if(flag == 0)
			{
				cout << a[i];
				flag =1;
			}
			else
			{
				cout << ' ' << a[i];
			}
			b[a[i]] = 1;
		}
		else continue;
	}
	cout << endl;
	return 0;
}
int main()
	{
		int n,i,k,x;
		int sz[20000];
		scanf("%d",&n);
		scanf("%d",&sz[0]);
		printf("%d",sz[0]);
		for(i=1;i<n;i++)
		{
			scanf("%d",&sz[i]);	
			x=0;
				for(k=0;k<i;k++)
				{

					if(sz[i]==sz[k])
					{
					break;
					}
					else if(sz[i]!=sz[k])
					{
						x++;
					}
					if(x==i)
					{
						printf(" %d",sz[i]);
					}
				}
		}
		
			return 0;
	}
int main()
{
    int n=0;
    cin>>n;
    int i=0,j=0;
    int a[n];
    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[i]==a[j])//?????????????????????j???i?????? 
                                    break;
                    }
    if(i==j)        //???????i?j?????a[i] 
    cout<<" "<<a[i];
    }
return 0;
}
int main()
{int n,a[20001],i,j,k,flag=0;
	scanf("%d",&n);
	if(n>=1&&n<=20000){
for(i=0;i<n;i++)
{scanf("%d",&a[i]);
if(a[i]<10||a[i]>=100)
scanf("%d",&a[i]);
else continue;}
printf("%d",a[0]);
for(j=1;j<n;j++){
	for(k=0;k<j;k++){
		if(a[j]==a[k])
		{flag=1;
			break;}
		
	}
if(flag==0)
printf(" %d",a[j]);
flag=0;
}
}
return 0;
}
/*
* kaiguandiandeng.cpp
*
*  Created on: 2010-10-28
*      Author: ??
*      ???????????
*/
int main()
{
	int N, n, i = 0, j = 0, a[20000];
	cin >> N;//???????
	while (i <= N - 1) {
		cin >> n;
		a[i] = n;
		i++;
	}//?????
	cout << a[0] ;//??????
	for (i = 1; i <= N - 1; i++) {
		for (j = 0; j < i; j++) {
			if (a[j] == a[i])
				break;//??????????????
		}
		if (j == i ) 
			cout << ' ' << a[i] ;//????????
	}
	return 0;
}
int main()
{
	int a[10000],n,i,j,t;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			if(a[i]==a[j]&&i>j)
			{
				t=0;
				break;
			}
			else t=1;
		}
		if(t==0)printf("\0");
		else 
		{
			if(i>0)printf(" %d",a[i]);
			else printf("%d",a[i]);
		}
	}			
	return 0;
}
int main()
{
	int n,i,j,k=1,a[20000]={0},b[20000]={0};
	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]) break;
			if(j==i-1) {b[k]=a[i];k++;}
		}
	}
	printf("%d",b[0]);
	if(k>1)
	{
		for(i=1;i<k;i++)
		printf(" %d",b[i]);
	}
	return 0;
}
int main()
{
    int n,i,s[20000],a[100];
    scanf ("%d",&n);
    for (i=0;i<n;i++)
    scanf ("%d",&s[i]);
    for (i=0;i<100;i++)
    a[i]=0;
    printf("%d",s[0]);
    a[s[0]]=1;
    for (i=1;i<n;i++)
    if(a[s[i]]==0)
    {
        printf (" %d",s[i]);
        a[s[i]]=1;
    }
    return 0;
}
/*
 * repeatnumber.cpp
 *
 *  Created on: 2012-11-16
 *      Author: ???
 */

int main() {
	int n, i, j = 2, m; //??int???
	int a[20010], b[100]; //????????
	cin >> n; //??n
	for (i = 1; i <= n; i++) {
		cin >> a[i];
	}
	b[1] = a[1];
	for (i = 2; i <= n; i++) {
		for (m = 1; m <= i - 1; m++) {
			if (a[m] == a[i])
				break; //??a[m]??a[i]???????
		}
		if (m == i) {
			b[j] = a[i];
			j++;
		}//?m??i??b[j]??a[i]
	}
	for (i = 1; i <= j - 1; i++) {
		if (i < j - 1) {
			cout << b[i] << " ";
		} else
			cout << b[i];
	}//?b[100]??????????
	return 0;
}
int main()
{
	int n , i , j , a[20010] , b[20010] ={0} , m= 0;
	cin >> n;
	for(i = 1 ; i <= n ; i++)
	{
		cin >> a[i];
		for(j = 0;j<=m ;j++)
		{
			if(a[i] == b[j])
			{
				break;
			}
			if(j == m)
			{
				b[m] = a[i];
				m++;
				break;
			}
		}
	}
	for(i = 0 ; i< m; i++)
	{
		if(i == m - 1)
			cout << b[i];
		else
			cout << b[i] << " ";
	}
return 0;
}
int main()
{
	int n,a[10000],i,j,x=0;
	scanf("%d\n",&n);
	for(i=0;i<=n-1;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<=n-1;i++)
	{
		if(a[i]==0)
		continue;
		for(j=i+1;j<=n-1;j++)
		{
			if(a[i]==a[j])
			{
			a[j]=0;
		}
}
}
printf("%d",a[0]);
	for(i=1;i<=n-1;i++)
	{
		if(a[i]!=0)
		printf(" %d",a[i]);
	
}
	return 0;
		
	
}
int main()
{
	int n,i,a[100000],j;
	scanf("%d\n",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	printf("%d",a[0]);
	for(i=1;i<n;i++)
		if(a[i]==a[0]) a[i]=0;
	for(i=1;i<n;i++)
	{
		if(a[i]!=0) 
		{
			printf(" %d",a[i]);
		    for(j=i+1;j<n;j++)
			     if(a[j]==a[i]) a[j]=0;
		}
	}
	return 0;
}
int main()
{
	int k, n, a[20001], i, j, b[20001] = {0};
	cin >> n;
	for (i = 1; i <= n; i++)
		cin >> a[i];
	for (i = 1; i <= n; i++)
		for (j = i + 1; j <= n; j++)
			if (a[i] == a[j])
				b[j] = 1;
	for (k = n; k > 0; k--)
		if (b[k] == 0)
			break;			
	for (i = 1; i < k; i++)
		if (b[i] == 0)
			cout << a[i] << ' ';
	cout << a[k];
	
	return 0;
}