semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int n;
	int i,j,flag;
	int a[MAX];
	scanf("%d",&n);
	a[0]=1;
	for(i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=1;i<=n;i++)
	{
		flag=1;
	    for(j=i-1;j>=0;j--)
		{
			if(a[i]==a[j])
			{
				flag=0;
				break;
			}
        }
		if(flag==1)
			if(i>1)
		       printf(" %d",a[i]);
			else
				printf("%d",a[i]);
	}
	return 0;
}
int main()
{
  int n , i , j , t , x ;
  cin>>n;
  int a[n];
  for ( i=0;i<n;i++)
   {
     cin>>x;
     a[i]=x;
    }
  for( i=0;i<n;i++)
    { 
      for ( j=i+1;j<n;j++)
        {
           if (a[i]==a[j])
            {
              for ( t=j;t<n;t++)
               {
                 a[t]=a[t+1];
               }
               n--;
               j--;
            }
         }
     }
  for (i=0;i<n-1;i++)
    {
      cout<<a[i]<<" ";
    }
  cout<<a[n-1]<<endl;
  return 0;
}
int main ()
{
	int i, n, t, p;
	int a[20000];
	scanf("%d", &n);
	for (i=0; i<n; i++) 
		scanf("%d", &a[i]);
	printf("%d", a[0]);
	for (i=1; i<n; i++) {
		p=0;
		t=0;
		do {
			if (a[i]==a[p]) 
				t=1;
			p+=1;
		}
		while (t==0&&p<i);
		if (t==0)
			printf(" %d", a[i]);
	}
	return 0;
}
int compare(int s, int a[20000], int n)
{
	int i, temp=0;
	for(i=0; i<n; i++)
	{
		if(s==a[i])
		{
			return 1;
			temp=1;
			break;
		}
		else
			continue;
	}
	if(temp=0)
		return 0;
}

int main()
{
	int n, a[20000], i, j, w=0;
	scanf("%d", &n);
	for(i=0; i<n; i++)
	{
		scanf("%d", &a[i]);
		if(compare(a[i], a, i)==1)
			a[i]=-1;
		else
			continue;
	}
	for(i=0; i<n; i++)
	{
		if(a[i]==-1)
			continue;
		else
		{
			if(w==0)			
				printf("%d", a[i]);
			else
				printf(" %d", a[i]);
			w++;
		}
	}
	printf("\n");
	return 0;
}
int main()
{
 int n,i,j,flag,a[20001];
	cin>>n;
	cin>>a[1];
	cout<<a[1];
      for(i=2;i<=n;i++)//???????????2?n????????????
		{flag=0;//??????flag???0????????a[i]??????flag??0
		   cin>>a[i];//??
	         for(j=1;j<i;j++)
			   {if(a[j]==a[i]) flag=1;}//????a[i]?????????flag???1
			 if(flag==0) cout<<" "<<a[i];//?flag?0???????????a[i]???????a[i]
		}
	  
	  return 0;
}
int main()
{
	int n;
	cin >> n;
	int a[20001] = { 0 };
	for(int i = 0; i < n; i++)
	{
		cin >> a[i];
		if ( i == 0 )
			cout << a[i];
		else
		{
			int t = 0;
			for(int j = 0; j < i; j++)
			{
				if ( a[i] == a[j] )
					t ++;
			}
			if( t == 0 )
				cout << " " << a[i];
		}
	}
	return 0;
}
int main()
{
    int n,a[20000];
    int count1,i,j,k;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    scanf("%d",&a[i]);
    for(j=0;j<n;j++)
    {
                    count1=0;
            for(k=0;k<j;k++)
            {
               if(a[j]==a[k])
               {
               count1=1;
               break;
               }
            }
            if(count1==0)
            {
                       if(j==0)
                       printf("%d",a[0]);
                       else
                       printf(" %d",a[j]);
            }
            
    }
    getchar();
     getchar();
      getchar();
       getchar();
        getchar();
         getchar();
          getchar();
    return 0;
}
/*
 * ????cout.cpp
 * ?????
 * ????: 2011-10-21
 * ???????????
 */
int main(){
	int n,i,j,k,l=1;//??????????????????
	cin>>n;//?????????
	int a[20000];//????
	for (i=0;i<n;i++)cin>>a[i];//??????
	for (i=0;i<n;i++)
	{
		int flag=0;
		for (j=0;j<i;j++)
		      {if(a[i]==a[j])//?????????
		   	   {
					  flag=1;
					  break;
	              }
		      }
		if (!flag) {cout<<a[i];break;}
	}
	i++;
	for (;i<n;i++)
	{
		int flag=0;
		for (j=0;j<i;j++)
	       {if(a[i]==a[j])//?????????
	    	   {
					  flag=1;
					  break;
               }
	       }
		if (!flag) cout<<' '<<a[i];
	}
    return 0;//????
}
int main()
{
	int n,a[30000],i,j,k,l,t=1;
	scanf("%d",&n);
	for(l=0;l<n;l++)
	scanf("%d",&a[l]);
    for(i=0;i<n;i++)
	{
	   for(j=i+1;j<n;)
		{
			if(a[i]==a[j])
			{
			  for(k=j;k<n-1;k++)
			  {a[k]=a[k+1];}
			  n=n-1;
			}
			if(a[i]!=a[j])j++;
			}
	}
	for(i=0;i<n;i++)
		if(t){
			printf("%d",a[i]);t=0;}
		else printf(" %d",a[i]);
	return 0;
}
int main()
{
	int n,i,a[30000],j;
	scanf("%d\n",&n);
	scanf("%d",&a[0]);
	printf("%d",a[0]);
    for(i=1;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=1;i<n;i++)
	{
        for   (j=0;j<=i;j++)
		{
			if (a[i]==a[j])
				break;
		}
	    if (j==i)
			printf(" %d",a[i]);
	}
	return 0;
}
/*
 * 1000012761_26.cpp
 *??n????n???????????????10-100???
???????????????????????????????????????????
 *  Created on: 2010-10-29
 *      Author:1000012761
 */

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

		return 0;
}
int main(int argc, char* argv[])
{
	int n;
	int histgram[101];
	int i;
	int x;

	scanf("%d",&n);
	for (i=0; i<101; i++)
	{
		histgram[i]=0;
	}

	scanf("%d", &x);
	histgram[x]++;
	printf("%d",x);

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

	return 0;
}
int main(){
	int n,u[20000],a[20000],b,c;
	b=0;
	c=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d ",&u[i]);
		a[i]=0;}
	if(n==1){
		printf("%d",u[0]);}
	else{
	for(int i=1;i<n;i++){
		for(int j=0;j<=i-1;j++){
			if(u[i]==u[j]){
				a[i]=a[i]+1;}}}
    for(int i=0;i<n;i++){
				if(a[i]==0){
                   b=b+1;}}
	for(int i=0;i<n;i++){
				if(a[i]==0){
					c=c+1;
					if(c<b){
						printf("%d ",u[i]);}
					if(c==b){
						printf("%d",u[i]);}}}}
	scanf("%d",&n);		
	return 0;
	}
int main() {
	int n;
	cin >> n;
	int a[n];
	for(int i1=0;i1<n;i1++)
		cin >> a[i1];
	int j=0;
	for(int i1=0;i1<n;i1++){
		j=i1+1;
		for (int i2=i1+1;i2<n;i2++)
		{
			if(a[i2]!=a[i1])
			{a[j]=a[i2];j++;}
		}
		n=j;
	}
	for(int i1=0;i1<n;i1++){
	cout << a[i1];
	if (i1!=n-1)
		cout << " ";
	}
	return 0;
}
/*
 * 4.cpp
 *
 *  Created on: 2011-12-30
 *      Author: Administrator
 */
int main()
{
	int a[10005], n, i, j, flag = 1,flag2 = 0;
	cin >> n;
	for( i = 1; i <= n; i++ )
	{
		flag = 1;
		cin >> a[i];
		for( j = 1; j <= i - 1; j++ )
		{
			if( a[j] == a[i])
				flag = 0;
		}
		if( flag )
		{
			if( flag2 == 0 )
			{
				cout << a[i];
				flag2 = 1;
			}
			else
				cout << " " << a[i];
		}
	}
	return 0;
}
void main()
{
	int n,i,j,k=0,flag,a[20000],b[20000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	for(i=0;i<n;i++)
	{
		flag=1;
	    for(j=0;j<i;j++)
		{if(a[i]==a[j])
	    flag=0;}
	    if(flag==1)
		{b[k]=a[i];
		k++;}
	}
	for(i=0;i<k-1;i++)
		printf("%d ",b[i]);
	printf("%d\n",b[i]);
}
int main()
{
    int n,i,j,a[100000],b[100000]={0},k;
    scanf("%d",&n);
    j=1;
    for(i=1;i<=n;i++)
    {
      scanf("%d",&k);
      if(b[k]==0)
      {
        a[j]=k;
        j++;
        b[k]=1;
      }
      }
      for(i=1;i<j;i++)
      {
        if(i==1)printf("%d",a[i]);
        else printf(" %d",a[i]);
        }
}
int main()
{
    int n, i, j, m = 0;
    cin >> n;
    int num[20001] = { 0 };
    for ( i = 1; i <= n; i++ )
        cin >> num[i];
    cout << num[1];
    for ( i = 2; i <= n; i++ )
    {
        int k = 0;
        for ( j = 1; j <= i - 1; j++ )
            if ( num[i] == num[j] )
            {
                 k = 1;
                 break;
            }
        if ( k == 0 )
           cout << " " << num[i];
    }
    return 0;
}
void main(){
	int n,a[20000],i,j,c;
	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++){
		for(j=0,c=0;j<i;j++){
			if(a[i]!=a[j]) c++;
		} 
		if(c==i) printf(" %d",a[i]);
	}
}
int main ()
{
	int n,i,j;
	int a[20000],flag[20000] = {0};
	cin >> 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])
				flag[i] = 1;
		}
		if (flag[i] == 0)
			cout << " " << a[i];
	}
	return 0;
}
int main()
{
	int k,i,j,n,t=0,b,p;
	int a[20000];
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	for(j=0;j<n-t;j++)
		{for(k=j+1;k<n-t;){
			if(a[k]==a[j]){
				for(p=k;p<n-t;p++)
			   a[p]=a[p+1];
			   t++;
			}
			else k++;
		}
	}
	for(b=0;b<n-1-t;b++)
		cout<<a[b]<<" ";
	cout<<a[n-1-t]<<endl;
	return 0;
}
//????????


int main()
{
	int n,a[20000],t=1,temp;  //????  ???????  ???????  ????
	cin>>n;
	cin>>a[0];            //????????????
	for(int i=1;i<n;i++)    //??n???
	{
		cin>>temp;
		for(int j=0;j<t;j++)    //??????????? ???? ?????? ??????
		{
			if(temp==a[j])
				break;
			if(j==t-1)        //?????  ???????? ??????????????????????
			{
				a[t]=temp;
				t+=1;
			}
		}
	}
	for(int i=0;i<t-1;i++)         //?????
		cout<<a[i]<<' ';
	cout<<a[t-1]<<endl;
	return 0;
}
/*
 * 1000012763_26.cpp
 *
 *  Created on: 2010-11-3
 *      Author: ??
 *      ???????
 */

int main() {
	int n, i, j, k, num = 0;
	cin >> n;
	int a[n];
	for (i = 0; i <= n - 1; i++)
		cin >> a[i];
	//????????????
	for (i = n - 1; i > 0; i--)
		for (k = i - 1; k >= 0; k--) {
			//??????????????0
			if (a[i] == a[k]) {
				if (i == n - 1) {
					a[i] = 0;
					num++;
					break;
					//???????????
				} else {
					for (j = i; j < n - 1; j++)
						a[j] = a[j + 1];
					a[j] = 0;
					num++;
					break;
				}
			}
		}
	//????????????0 ???
	cout << a[0];
	for (i = 1; i < n - num; i++)
		cout << " " << a[i];
	cout << endl;
	return 0;
}
int main()
{
	int n,i,j,k,p,q,m;
	int a[20000];
	int b[20000];


	scanf("%d",&n);



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




	for(j=1;j<n;j++)
	{
		b[j]=0;
		for(k=0;k<j;k++)
		{
			if(a[j]==a[k])
				b[j]++;
		}

	}

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

	for(p=1;p<n;p++)
	{
		if(b[p]==0)
			printf(" %d",a[p]);
	}
	



	return 0;
}
void main()
{int a[20001];
int i,k,j=0,n,fil=101,m=0,g=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{scanf("%d",&a[i]);}
k=0;
a[n]=101;

while(k<n)
{
  
for(i=0;i<k;i++)
   {
    if(a[i]==a[k])
    k++;
   }
for(i=0;i<k;i++)
   {
    if(a[i]==a[k])
    k++;
   }
if(k==0)
printf("%d",a[k]),k++;

else
if(k<n&&k>0)
printf(" %d",a[k]),k++,m++;
}

}
int main()
{
	long n,i,j,x,y,ans,b[200];
	scanf("%d",&n);
for (i=1;i<=100;i++) b[i]=0;
	for (i=1;i<=n;i++)
	{
		scanf("%d",&x);
if (b[x]==0) 
  if (i==1) printf("%d",x);else printf(" %d",x);
b[x]=1;
	}

}
struct arr
{
	long int num;
	struct arr *next;
};
int n;
struct arr *create(int m)                   /*  m?????   */
{
	struct arr *head;
	struct arr *p1,*p2;
	n=1;
	p1=p2=(struct arr *) malloc(LEN);
	scanf("%ld",&p1->num);                             /* ??????????*/
	head=p1;
	while(n<m)
	{
		p1=(struct arr *)malloc(LEN);
		p2->next=p1;
		n++;
		p2=p1;
		scanf("%ld",&p1->num);                         /* ??????????*/
	}
	p1->next=NULL;
	return(head);
}
void print(struct arr *head)
{
	struct arr *p;
	p=head;
	while(p!=NULL)
	{
		if(p==head)
		printf("%ld",p->num);
		else printf(" %ld",p->num);            /* ????????????? */
		p=p->next;
	}
}
void freelist(struct arr *head)
	{
		struct arr *p=head ;
		while(p!=NULL)
		{
			head=head->next;
			free(p);
			p=head;
		}
}
struct arr *del(struct arr *head,long int dnum)
{
	struct arr *p1,*p2;
	p1=p2=head;
	while(p1!=NULL&&p1->num==dnum)
		{
			head=p1->next;
			p2=head;
			free(p1);
			p1=head;
		}
	while(p1!=NULL)
	{
			p2=p1;
			p1=p1->next;
		while(p1!=NULL&&p1->num==dnum)
		{
			p2->next=p1->next;
			free(p1);
			p1=p2->next;
		}
		
	}
	return(head);
}


void main()
{
	int m;
	struct arr *head,*p;
	scanf("%d",&m);
	head=create(m);
	p=head;
	while(p!=NULL)
	{
		p->next=del(p->next ,p->num);
		p=p->next;
	}
	print(head);
	freelist(head);
}
int main()
{
	int n,i,m,flag;
	scanf("%d",&n);
	int a[200000];
	for (i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	if(n==1)
		printf("%d",a[1]);
	else
	{
	printf("%d",a[1]);
	for (i=2;i<=n;i++)
	{
		for (m=1;m<i;m++)
		{
			if (a[i]==a[m])
			{
				flag=1;
				break;
			}
			else
				flag=-1;
		}
		if(flag==-1)
			printf(" %d",a[i]);
	}

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

	cin >> n;
	for (i = 1; i <= n; i ++) {
		cin >> t;		
		if ((f != 0)&&(!a[t]))
			cout << " ";
		else
			f = 1;
		if (!a[t]) cout << t;
		a[t] = 1;
	}
	return 0;
}
int main() {


	int n;
	scanf("%d", &n);

	int visit[101] = {0};

	int i;
	for(i = 0; i < n; i++) {
		int num;
		scanf("%d", &num);
		if(visit[num] == 1) {

		} else {
			if(i != 0) {
				printf(" ");
			}
			printf("%d", num);
			visit[num] = 1;
		}
	}
	printf("\n");


	return 0;
}
int main()                               
{
	int num[20000],output[20000];        
	int i=0,n=0,j=0,k=0;                 
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&num[i]);                     
		for(j=0;j<k;j++)
			if(num[i]==output[j])
				num[i]=0;                
		if(num[i]!=0)
		{
			output[k]=num[i];
			k=k+1;
		}                                
	}
	for(i=0;i<(k-1);i++)
		printf("%d ",output[i]);
	printf("%d",output[k-1]);                   
	return 0;
}
int main(){
	int n,i,j,k;
	cin>>n;//??????n
	int a[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]){//????????
			  for(k=j;k<n;k++){
				  a[k]=a[k+1];
			  }
			  j--;
			  n--;//??????????
		  }
	  }
	}
	for(i=0;i<n-1;i++)
		cout<<a[i]<<' ';//??????
	cout<<a[i];//???????
	return 0;
}
/*
 * ????27.cpp
 * ??:???
 * ????: 2012-11-10
 * ??:????????
 */


int main(){
	int n=0,flag[90];                           //flag??????????????????????????????
	                                            //???????????10???100?????flag90???
	cin>>n;
	int a[n];                                   //?a[n]???????
	for(int i=0;i<n;i++){
		cin>>a[i];
		flag[a[i]-10]=1;                        //?10~99????x???,?flag[x-10]=1,????????x?
	}
		for(int j=0;j<n;j++){
		if(flag[a[j]-10]){
			if(j){                               //????????????????
				cout<<' '<<a[j];
			}else{
				cout<<a[j];
			}
		}
		flag[a[j]-10]=0;                         //???flag[x-10]??0???????????
	}
	return 0;
}
int main()
{
    int a[20000], i, j, n, r = 0, s = 0;
    
    cin >> n;
    
    for(i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    
    for(i = n - 1; i > 0; i--)
    for(j = i - 1; j >= 0; j--)
    {
        if(a[i] == a[j])
        {
            a[i] = -1;
            r++;
        }
    } 
    for(i = 0; i < n; i++)
    {
        if(a[i] != -1)
        {
            if(s != n - r - 1)
            {
                cout << a[i] << " ";
                s++;
            }
            else cout << a[i] << endl;
        }
    }

    return 0;
}
int main()
{
    int i,j,s,n;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++)
    {
    scanf("%d",&a[i]);
    }
    
    for(i=0;i<n;i++)
    {
    if(i==0)
    {printf("%d",a[0]);}
    else
    {                
    for(j=0;j<=i-1;j++)
    {
    if(a[j]==a[i])
    {
    a[i]=0;
    break;
    }
    }
    if(a[i])
    {printf(" %d",a[i]);}
    }
    }
printf("\n");
getchar();
getchar();
getchar();
return 0;
}
//*???????????
//*??????
//*?????2010?10?
//*????????????

int main()
{
	int a, n, i;
	int f[20001] = {0};                //?0
	cin >> n;
	for(i = 1; i <= n; i++)
	{   
		cin >> a;
		if(f[a] == 0)                  //??0?????????????
		{
			if(i == 1)
			   cout << a;
		    else
			   cout << " " << a;
			f[a] = 1;                  //a???????1
		}
	}
	return 0;
}
int main()
{
	int n,i,t,s,r;
	int a[20000];
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
	{
		scanf("%d",&a[i]);
	}
	printf("%d",a[0]);
	for(t=1;t<=n-1;t++)
	{
		r=0;
		for(s=0;s<=t-1;s++)
		{
			if(a[t]==a[s])
				break;
			else
				r++;
		}
		if(r==t)
			printf(" %d",a[t]);
	}
	return 0;
}
int main()
{
	int n,i,e,k = 0;
	int s[20001];
	int a[20001];
	cin >> n;
	for (i = 1;i <= 20001; i++)
	{
		s[i] = 0;
		a[i] = 0;
	}
	for (i = 1;i <= n;i++)
	{
		cin >> e;
		if (a[e] == 0)
		{
			a[e] = 1;
			k ++;
			s[k] = e;
		}
	}
	for (i = 1;i <= k-1;i++)
     	cout << s[i] << ' ';
	cout << s[k];
	return 0;
}
int main()
{
    int n,a[20000],i,j,b[100],t=1;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        for(j=0;j<t;j++)
        if(a[i]==b[j]) break;
        if(j>=t)
         {
          b[t]=a[i];
          t++;
         }
    }
      for(j=1;j<t-1;j++)
      printf("%d ",b[j]);
      printf("%d",b[t-1]);
}
void main()
{
	int n, i, j, s[20001];
	scanf("%d", &n);

	for(i=1; i<=n; i++) scanf("%d", &s[i]);
	printf("%d", s[1]);
	for(i=2; i<=n; i++)
	{
		for(j=1; j<i; j++)
		{
			if (s[i]==s[j]) {s[i]=0;break;};//????????????????????????
		};
	};
	
	for(i=2; i<=n; i++)
	{
		if (s[i]!=0) printf(" %d", s[i]);//?????
	};	
}
int main()
{
	int n,i,j,k,l=0;
	cin>>n;
	int a[n];
	for(i=0;i<n;i++)
		cin>>a[i];
	for(i=0;i<n;i++)
		for(j=n-1;j>i;j--)
		{if (a[i]==0)
			break;
			if(a[j]==a[i])
			{for(k=j;k<n;k++)
				a[k]=a[k+1];
			a[k]=0;
			l=l+1;
			}
		}
	for(i=0;i<n-l;i++)
		{if(i==0)
			cout<<a[i];
		else
			cout<<" "<<a[i];}
	return 0;
}
int main()
{int i,j,a[20000],n;
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=0;j<i;)
{if(a[i]==a[j]) j=i+1;
else j++;
if(j==i) printf(" %d",a[i]);}}}
int main() {
	int n,sum=0;
    cin >> n;
    int shu[n];
    for(int i=0;i<n;i++)
    cin >> shu[i];
    for(int i=0;i<n;i++)
    {
      if(i==0)
      cout << shu[i];
      if(i>0)
      {
        for(int j=0;j<i;j++)
        {
          if(shu[i]==shu[j])//??????????????? 
          {
            shu[i]=0;//??????0???? 
          }
        }
        if(shu[i]!=0)
        cout << " " << shu[i];
      }
    }
	return 0;
}
int main()
{
      int a,b,c[100000],d,e;
      e=0; 
      scanf("%d",&a);
     for(b=1;b<=a;b++)
     scanf("%d",&c[b]);
     printf("%d",c[1]);
     b=2;
     while(b<=a)
     {
                e=0;
      for(d=1;d<b;d++)
      {
        if(c[b]==c[d])
        e=1;
        else 
        e=e;
        }
          if(e==0)
          printf(" %d",c[b]);
          b=b+1;
          }
          getchar();
          getchar();
          }
int main()
{
	int n,a[20000], i, j, flag, g;
	cin>>n;
	g = 0;
	for(i=0;i<n;i++) {
		cin>>a[i];
		flag = 1;
		for (j=0; j<i; j++)
			if (a[j]==a[i]) { flag = 0; break; }//??a[i]????????????????flag
			if (flag==1) 
				if (g) {
					cout<<" "<<a[i];//???????a[i]
				} else { cout<<a[i]; g=1;}
	}
	cout<<endl;
	return 0;
}
int main()
{
	int n,i,j,k,a[20000],b=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d",&a[i]);
	printf("%d",a[0]);
	for(j=1;j<n;j++){
		for(k=0;k<=j;k++){
	if(a[k]!=a[j])b++;
		}
		if(b==j)printf(" %d",a[j]);
		b=0;
	}
	return 0;

}
int main()
{
    register int i,j,flag;
int n;
    flag=0;
    char str1[20000];
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
                     scanf("%d",&str1[i-1]);
                     if(i>=2)
                     {
                            flag=0;
                             for(j=1;j<=i-1;j++)
                             {
                                                if(str1[i-1]==str1[j-1])
                                                {
                                                                       flag=1;
                                                                       break;
                                                                       }
                                                                       }
                                                                       if(flag==0)
                                                                       {
                                                                                  printf(" %d",str1[i-1]);
                                                                                  }
                                                                                  }
                                                                                  else
                                                                                  {
                                                                                      printf("%d",str1[0]);
                                                                                      }
                                                                                  }
                                                                                  return 0;
                                                                                  }
int main()
{
	int n, i, j, k = 1, r = 1, number[20001], number1[20001] = {0};
	cin >> n;
	for (i = 1; i != n + 1; i++)
	{
		cin >> number[i];
		for (j = 1, k = 1; j <= i; j++)
		{
			if (number[i] == number1[j])
			{
				k = 0;
				break;
			}
		}
		if (k == 1)
		{
			if (i == 1)
			{
				cout << number[1];
				number1[1] = number[1];
				r++;
			}
			else
			{
				cout << " " << number[i];
				number1[r] = number[i];
				r++;
			}
		}
	}
	return 0;
}
//*????1000012912_004.cpp
//*??????
//*?????2010.10.27
//*??????????
int main()
{
	int n, i, j, k, m, a[20000];               //????
	cin >> n;                                  //?????
	for ( i = 0; i < n; i ++ )                 //???????
		cin >> a[i];
	for ( j = 0; j < n; j ++ )              
	{
		for ( k = j + 1; k < n; k ++ ) 
		{
			if ( a[j] == a[k] )             //??j+1????k+1????
			{
				for ( m = k + 1; m < n; m ++ )     //?????????
					a[m - 1] = a [m];
				n -= 1;                          //?????
				k -= 1;
			}
		}
	}
	for ( i = 0; i < n - 1; i ++ )
		cout << a[i] <<" ";
	cout << a[n-1];                               //????????
	return 0;
}
int main()
{
	int i,j,k=0,l=0,g=0,n,a[20000],b[20000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	if(n==1)
		printf("%d",a[0]);
	else
	{
		for(i=n-1;i>=0;i--)
		{
			if(a[n-1]==a[i])
				k++;
		}
		if(k==n)
			printf("%d",a[0]);
		else
		{
			printf("%d ",a[0]);
			for(i=1;i<n;i++)
			{
				for(j=i-1;j>=0;j--)
				{
					if(a[i]!=a[j])
						l++;
				}	
				if(l==i)
				{
					b[g]=a[i];
				    g++;
				}
					l=0;
			}
			for(i=0;i<g-1;i++)
			{
				printf("%d ",b[i]);
			}
			printf("%d",b[g-1]);
		}
	}
	return 0;
}
int main()
{
      int n,i=1,m,j,k;
      scanf("%d",&n);
       int a[n];
      while(i<=n)
      {scanf("%d",&m);
      a[i]=m;
      i++;} 
      int l=1;
      while(l<=n)
      {
                 if(l==1)
                 printf("%d",a[l]);
                 else
                 {
                     j=1;
                     k=0;
                     while(j<l)
                     {if (a[l]==a[j])
                     k=k+1;
                     j++;}
                 if(k==0)
                 printf(" %d",a[l]);
                 }             
      l++;
      }
      getchar();
      getchar();
}
main()
{
    int a[20000],n=0,i=0,j=0,c=0;
    
    for (i=0;i<20000;i++) a[i]=0;

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

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

}