semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//********************************
//*???????????   **
//*?????? 1300012957 **
//*???2013.11.12  **
//********************************
int main ( )
{
	int array[100][100];              //????????????????        
	int row, col;                     //row?????col????
	cin >> row >> col;     
	int i,j,k,a,b,c,d;                //k?????ij???????a,b,c,d??????????
	int A=0,B=0,C=0;                  //A?B?C?????????????????
	int sum=0;                        //sum ???????????????
	for( i = 0 ; i <= row - 1 ; i++ )
	{
		for( j = 0 ; j <= col - 1 ; j++ )
		{
			cin >> array[i][j] ;      //??????
		}
	}
	for( k = 0 ; ; k++ )               //?k?????
	{
		for( a = k ; a <= col - k - 1 ; a++ ) 
		{
			cout << array[k][a] << endl ;      //???k+1? ?a+1???
			sum++ ;                            //sum????
			if( a == col - k - 1 )
				A = array[k][a] ;               //?????????????????????
		}
		if( sum == row * col )
			break ;                            //?????????????????????????????
		for( b = k ; b <= row - k - 1 ; b++ )
		{
			if( array[b][col-k-1] == A )
				continue ;                      //???????????
			cout << array[b][col-k-1] << endl ; //???k+1??b+1???
			sum++ ;                            //sum??????????
			if(b == row - k - 1 )     
				B = array[b][col-k-1] ;         //????????????????????
		}
		if( sum == row * col )
			break;                              //?????????????????????????????        
		for( c = col - k - 1 ; c >= k ; c-- )
		{
			if( array[row-k-1][c] == B )
				continue ;                     //??????????? 
			cout << array[row-k-1][c] << endl ;
			sum++ ;                            //sum??????????
			if( c == k )
				C = array[row-k-1][c] ;       //????????????????????
		}
		if( sum == row * col )
			break ;                            //?????????????????????????????
		for( d = row - k - 1 ; d >= k+1 ; d-- )
		{
			if( array[d][k] == C )
				continue ;                    //???????????
			cout << array[d][k] << endl ;
			sum++ ;                           //sum??????????
		}
		if( sum == row*col )
			break ;                            //?????????????????????????????
	}
	return 0 ;
}
void main()
{int i,j,*p,a[100]={0},n,t=0;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
p=&a[0];
for(i=0;i<n-1;i++)
{t=p[n-1];
for(j=n-1;j>=i+1;j--)
{p[j]=p[j-1];}
p[i]=t;
}
printf("%d",*p);
for(p=a+1;p<(a+n);p++)
printf(" %d",*p);
}
int main()
{
    int n,a[100],*p,i;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
          scanf("%d",&a[i]);
     }
     p=a;
     for(i=n-1;i>=0;i--)
     {
                 if(i==n-1)
                 printf("%d",*(p+i));
                 else
                 printf(" %d",*(p+i));
       }
      return 0;
}
/*??
?????????????????????????8,6,5,4,1?????1,4,5,6,8?
????
?????????????????n?1 < n < 100)?????n?????????????????
????
??????????????????????????????
????
5

8 6 5 4 1
????
1 4 5 6 8*/
int main()
{
	int n,i,x=0,t,a[99999],b[999999];
	cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	for(i=1;i<=n;i++)
	{
		b[i]=a[n+1-i];
	}
	for(i=1;i<=n;i++)
	{
		x++;
		if(x==1)
		{
		cout<<b[i];
		}
		else
		{
			cout<<" "<<b[i];
		}
	}
	return 0;

}
int main(){
     int n,t,m;
     scanf("%d\n",&n);
     int sz[n];
     for(int i=1;i<=n;i++){
         scanf("%d",&(sz[i]));
     }
     for(int i=n;i>1;i--){
         printf("%d ",sz[i]);
     }
     printf("%d",sz[1]);
     return 0;
 }
int main()
{
	int x[100];
	int n,i;
	int *p=NULL;
	scanf("%d",&n);
	p=&x[0];
	for(i=0;i<n;i++)
		scanf("%d",&x[i]);
	for(i=0;i<n;i++)
	{
		if(i!=0)
			printf(" ");
		printf("%d",*(p+n-i-1));
	}
	printf("\n");
	return 0;
}
/*
 * affairs.cpp
 *
 *  Created on: 2012-11-1
 *      Author: Administrator
 */

int main() {
	int a[100], i, j, k, n, temp;//i,j,k??????temp?????
	cin >> n;
	for (k = 1; k <= n; k++) {
		cin >> a[k];//??????
	}
	for (i = 1, j = n; i < j; i++, j--) {
		temp = a[i];
		a[i] = a[j];
		a[j] = temp;//??a[i]?a[j]
	}
	cout << a[1];
	for (k = 2; k <= n; k++) {
		cout << " " << a[k];//a[1]???????????????????
	}
	return 0;
}
int main()
{
	int n=0,k=0;//????n
	int num[100];//??
	cin>>n;
	memset(num,0,sizeof(num));
	for (k=0;k<n;k++)//??
	{
		cin>>num[k];
	}
	k=n-1;
	for (k=n-1;k>0;k--)//????
	{
		cout<<num[k]<<' ';
	}
	cout<<num[0];
	return 0;
}
int n,i;
void nixu(int a[100])
{
	for(i=n-1;i>0;i--)
	{
		cout<<a[i]<<" ";
	}
	cout<<a[0];
}//????????????
int main()
{
	int a[100];
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}//????
	nixu(a);//????
	return 0;
}
int main()
{
	void inv(int array[ ],int k);
	int i,n,a[100],*p;
	scanf("%d",&n);
	for(p=a;p<a+n;p++)
		scanf("%d",p);
	inv(a,n);
	printf("%d",*a);
	for(p=a+1;p<a+n;p++)
        printf(" %d",*p);
}

    void inv(int array[ ],int k)
	{
		int temp,j,m;
        m=k/2;
		for(j=0;j<m;j++)
		{
			temp=*(array+k-j-1);
			*(array+k-j-1)=*(array+j);
			*(array+j)=temp;
		}
		return;
	}
int main(){
    int sz[100];
    int n;
    int e;
    int a,b;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
            scanf("%d",&(sz[i]));}
    b=n/2;
    for(int k=0;k<b;k++){
            a=n-k-1;
            e=sz[a];
            sz[a]=sz[k];
            sz[k]=e;
            }

    for(int i=0;i<n;i++){
            printf("%d",sz[i]);
            if(i<n-1){printf(" ");
            }
            }
    return 0;
    
                    
    }
int main()
{
	int n,i,a[100],t;
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d",&a[i]);
	for(i=0;i<n/2;i++)
	{t=a[i];a[i]=a[n-1-i];a[n-1-i]=t;}
	for(i=0;i<n;i++)
	{printf("%d",a[i]);
	 if(i==n-1)break;
	 printf(" ");
	}
}
int function(int* a,int n)
{
	if(n!=1)
	function(a+1,n-1);
	cout<<a[0]<<' ';
	return 0;
}

int main()
{
	int n,a[100];
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	function(a+1,n-1);
	cout<<a[0];
	return 0;
}
int main(){
	int n;
	cin>>n;
	int a[100];
	int *p=a,*q=a;
	for(;p<a+n;p++)
		cin>>*p;
	int temp;
	for(p--;q<p;q++,p--)
	{
		temp=*q;
		*q=*p;
		*p=temp;
	}
	p=a;
	cout<<*p++;
	for(;p<a+n;p++)
		cout<<" "<<*p;
}
int main()
{
	int s[100],n,*p,*q,i,temp;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",s+i);
	p=s;
	q=s+n-1;
	while(p<q)
	{
		temp=*p;
		*p=*q;
		*q=temp;
		p++;
		q--;
	}
	for(i=0;i<n-1;i++)
		printf("%d ",*(s+i));
	printf("%d",*(s+n-1));
	return 0;
}
int main()
{
	int n=0;
	cin>>n;
	int i=0;
	int j=0;
	int in[100]={0};
	int out[100]={0};
	for(i=0;i<n;i++)
	{
		cin>>in[i];
	}
	for(i=0,j=n-1;i<n,j>=0;i++,j--)
	{
		out[j]=in[i];
	}
	for(i=0;i<n-1;i++)
	{
		cout<<out[i]<<" ";
	}
	cout<<out[n-1]<<endl;
	return 0;
}
/*
 * reverse.cpp
 *
 *  Created on: 2012-10-26
 *      Author: 12001
 */



int main()
{
	int n;
	int a[100];
	cin >> n;
	for (int i=0;i<n;i++){
		cin >> a[i];
	}
	for (int i=0;i<n/2;i++){
		int tmp=a[i];
		a[i]=a[n-1-i];
		a[n-1-i]=tmp;
	}
	for (int i=0;i<n;i++){
		cout << a[i];
		if (i==n-1)
			cout << endl;
		else
			cout << ' ';
	}
	return 0;
}
const int maxn=100;			//??????????????????const??????)
int main()
{
	int a[maxn],b[maxn];	//???????????????????????
	int n,i=0,j=0;			//??n??????????????
	cin>>n;					
	while(i<=(n-1))			//???????????a[n]
	{
	cin>>a[i];
	b[n-1-i]=a[i];			//???????????b?a??????
	i++;
	}
		while(j<(n-1))		//?????
		{
		cout<<b[j]<<" ";	//???????
		j++;
		}
		if(j==(n-1))
		cout<<b[j];
		return 0;
}
void p(int n)   //??n???
{
	int c;
	cin>>c;
	if(n!=1)
		p(n-1);   //??????
	if(n==1)      //???????????
		cout<<c;
	else
		cout<<' '<<c;
}
int main()
{
	int n;
	cin>>n;  //??n
	p(n);
	cout<<endl;
	return 0;
}
int main(){
int n,k;
int i;
int sz[100];
scanf("%d",&n);
i=0;
k=n-1;
while(i<n){
scanf("%d",&sz[i]);
i++;
}
while(k>=0){
    if(k!=0){
    printf("%d ",sz[k]);}
    else{printf("%d",sz[k]);}
    k--;
}
return 0;
}
int main()
{
    int n,a[100];
    cin>>n;
    int *p;
    p=a; 
    for (int i=0;i<n;i++)
      {
        int x;
        cin>>x;
        *p=x;
        p++;
      }
     for (int i=n-1;i>0;i--)
      {
          p--;    
         cout<<*p<<" ";
      }
      p--;
      cout<<*p;
      return 0;
}
//============================================================================
// Name        : 2.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================


int main() {
	int n;
	cin>>n;
	int a[100],b[100];
	for(int i=0;i<n;i++)
		cin>>a[i];
	for(int i=0;i<n;i++)
		b[i]=a[n-1-i];
	cout<<b[0];
	for(int i=1;i<n;i++)
	{
		a[i]=b[i];
		cout<<" "<<a[i];
	}
	return 0;
}
int main(){
	int n,i,e;
	scanf("%d",&n);
	int sz[101];
	i=0;e=n-1;
	while(i<n){
		scanf("%d",&sz[i]);
		i++;
	}
	while(e>0&&e<n){
		printf("%d ",sz[e]);
		e--;	
}
printf("%d",sz[e]);

	return 0;
}
int main(){
	int a[99],n=0,i=0,j=0,e=0;
	cin>>n;
	for(i=0;i<=n-1;i++)
	{
		cin>>a[i];
	}
	for(j=n-1;j>0;j--)
		cout<<a[j]<<" ";
		cout<<a[0];
		return 0;
}
void main()
{
	int i,n,*p;
	scanf("%d",&n);
	p=(int *)(malloc(n*sizeof(int)));
	for(i=0;i<n;i++)
	{
		scanf("%d",p+i);
	}
	for(i=n-1;i>0;i--)
	{
		printf("%d ",*(p+i));
	}
	printf("%d",*(p+i));
}
/*
 * nixu.cpp
 *
 *  Created on: 2012-11-5
 *      Author: alias
 */
int main(){//???
	int n;//????n
	cin>>n;//??n
	int a[n];//????
	for(int i=0;i<n;i++)//????????
		cin >>a[i];
	int m;
	for(int j=0;j<n/2;j++){//?n/2??????????
		m=a[j];
		a[j]=a[n-j-1];
		a[n-j-1]=m;
	}
	for(int k=0;k<n;k++){//??????????
		if(k==0)
			cout<<a[k];
		else
			cout<<" "<<a[k];
	}
	return 0;
}
int main()
{
	int n,i,e,j;
	 
	scanf("%d",&n);
    int a[100],b[100];
	
	for(i=0;i<n;i++){
scanf("%d",&(a[i]));
		
	}
	for(j=0;j<n;j++){
   b[j]=a[n-j-1];
	}
	for(e=0;e<n;e++){
		if(e==n-1){
			printf("%d",b[e]);
		}
		else 
		{
			printf("%d ",b[e]);
		}
	}
		return 0;
}
int main(int argc, char* argv[])
{
	int n,i,j,a[111],b[111];
	scanf ("%d",&n);
	j=n-1;
	for (i=0;i<n;i++)
	{
		scanf ("%d",&a[i]);
		b[j]=a[i];
		j--;
	}
	for (j=0;j<n-1;j++)
	printf("%d ",b[j]);
	printf("%d\n",b[n-1]);
	return 0;
}
int main()
{
	int a[100],i=0,j=0,k=0,t1=0,t2=0,sum=0,n;
	scanf("%d",&n);

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

	return 0;
}
int main()
{
int n,a;//????
cin>>n;//??
int value[100];//????
for (a=1;a<=n;a=a+1){
cin>>value[a];
}
for(a=n;a>1;a=a-1){
	cout<<value[a]<<' ';
}
cout<<value[1];
return 0;
}
int mark=0;
int main()
{
    int sum;
	void print(int);
	cin>>sum;
	print(sum-1);
	return 0;
}
void print(int num)
{
	int temp;
	cin>>temp;
	if(num==0)
	{	
		mark=1;
		cout<<temp;
		return;
	}
	else
		print(num-1);
    if(mark)
		cout<<" "<<temp;
    
}
int main(){

    int sz[100];

    int i,e,n,k,dt;

    scanf("%d",&n);

    for(i=0;i<n;i++){

        scanf("%d",&(sz[i]));

    }

    for(e=1;e<=n;e++){

        for(k=0;k<n-e;k++){

            dt=sz[k];

            sz[k]=sz[k+1];

            sz[k+1]=dt;

        }

     }

     for(i=0;i<n;i++){

         if(i<n-1){

         printf("%d ",sz[i]);

         }else{

         printf("%d",sz[i]);

         }

      }

     return 0;

}
/*??????*/
int main()
{
	int n;
	int num[100];
	cin>>n;//?????????n
	int i,j;
	int t;
	for(i=0;i<n;i++)//????num
	{
		cin>>num[i];
	}
	for(i=0,j=n-1;i<=(n-1)/2;i++,j--)//??????
	{
		t=num[i];
		num[i]=num[j];
		num[j]=t;
	}
	for(i=0;i<n-1;i++)
	{
		cout<<num[i]<<" ";//??????
	}
	cout<<num[n-1]<<endl;
	return 0;
}
int main()
{
    int m,i;
	scanf("%d",&m);
	int A[100],B[100];
	for (i=0;i<m;i++)
		scanf("%d",&A[i]);
	for (i=0;i<m;i++)
		B[i]=A[m-i-1];
	
	for (i=0;i<m-1;i++)
		printf("%d ",B[i]);
	printf("%d",B[m-1]);
	return 0;
}
int main(int argc, char* argv[])
{
int n;
scanf("%d",&n);
int a[100];
int i;
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i=n-1;i>0;i--){
printf("%d ",a[i]);
}
printf("%d\n",a[i]);
	return 0;
}
int main()
{
    int n=0;
    int i;
    cin >> n;//?? n
    int a[100]={0};
    for (i=1;i<=n;i+=1)   cin>>a[i];
    for (i=n;i>=2;i-=1)   cout<<a[i]<<" ";
    cout<<a[1];//?? 
 
    
    return 0;
}
int main()
{

	int n=0;
	cin>>n;
	int a[100]={0},b[100]={0};
	for(int i=0;i<n;i++)
	{ 
		scanf("%d",&a[i]);            //????
	}
	
	for(int i=0;i<n;i++)             //????
		b[i]=a[n-i-1];
  for(int i=0;i<n-1;i++)
	{ 
                printf("%d ",b[i]);   //????
                                  }
   printf("%d",b[n-1]);
}
int main(){
    int n,sz[100];
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        if(i!=n-1){
            scanf("%d ",&sz[i]);
        } else{
            scanf("%d",&sz[i]);
        }
    }
    for(int j=n-1;j>=0;j--){
        if(j!=0){
            printf("%d ",sz[j]);
        } else{
            printf("%d",sz[j]);
        }
    }
    return 0;
}
int main()
{
	int a[110],*p,n,*i,*j;
	cin>>n;
	for(i=a;i<a+n;i++)
	{
		cin>>*i;
	}
	for(j=a+n-1;j>a;j--)
	{
		cout<<*j<<' ';
	}
	cout<<*a;
	
	return 0;
}
int main()
{
int i,n;
int num [100];
scanf("%d",&n);
i=0;
while(i<n){
	scanf("%d",&num [i]);
	i++;
}
i=n-1;
while(i>0){
	printf("%d ",num [i]);
	i--;
}
printf("%d",num [0]);
return 0;
}
int main()
{
	int i,n,a[100];
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	int *p = NULL;
	p = &a[n-1];
	while(i>1)
	{
		cout<<*p<<" ";
		i--;
		p--;
	}
	cout<<*p;
	return 0;
}
int main()
{
	int a[101],i,m,n;
	cin>>n;
	for(i=0;i<n;i++)
	{
	cin>>a[i];
	}
	m=i;
	for(i=m-1;i>0;i--)
	{
		cout<<a[i]<<" ";
	}cout<<a[0];
			 	cin.get();cin.get();cin.get();
	return 0;
	}
int main ()
{
    int n,i,j;
    cin >>n;
    int a[1000],b[1000];
    for (i=0;i<n;i++)
    cin >>a[i];
    for (i=n-1;i>=1;i--)
    {
        cout <<a[i] <<' ';
    }
    cout <<a[0]<<endl;
    return (0);
}
int main()
{
	void nixu(int,int a[]);
	int i,a[100]={0},n;
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	nixu(n,a);
	return 0;
}

void nixu(int n,int a[])
{
	if(n==1) cout<<a[0];
	else
	{
	cout<<a[n-1]<<' ';
	nixu(n-1,a);
	}
}
void NX();
int n;
int sz[100],nx[100];
int main(){
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&sz[i]);
    }
    NX();
    for(int i=0;i<n;i++){
        if(i<n-1){
        printf("%d ",nx[i]);
        }else{
            printf("%d",nx[i]);
        }
    }
    return 0;
}
void NX(){
    int j;
    j=0;
    for(int i=n-1;i>=0;i--){
        nx[j]=sz[i];
        j++;
    }
}
int main()
{
	int a[100],n,i,j,k,t;//??a???????n??????
	cin>>n;//??n
	for (i=0;i<n;i++)
	{
		cin>>a[i];//?????
	}
    for (j=n-1;j>=0;j--)
	{
		for(k=0;k<j;k++)
		{
		 {t=a[n-k-1];a[n-k-1]=a[n-k-2];a[n-k-2]=t;}//?????????????
		}
	
	}
	for (i=0;i<n;i++)
	{
		cout<<a[i];
		if(i!=n-1)cout<<" ";//?????????????
	}
	return 0;

}
void main(int argc, char* argv[])
{
	int a[100],b[100];
	int i,n;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		b[n-1-i]=a[i];
	}
	for (i=0;i<n;i++)
	{
		if (i==n-1)
		{
			printf("%d",b[i]);
		}
		else
		{
			printf("%d ",b[i]);
		}
	}
}
int main()
{
    int n,*q,i,j;
    cin>>n;
    int a[n];
    q=a;
    for(int i=0;i<n;i++)
    cin>>a[i];           //???? 
    cout<<*(q+n-1);
    for( j=n-2;j>=0;j--)
    cout<<" "<<*(q+j);      //?????????? 
    cout<<endl;
     
return 0;
}
int main()
{
    int a[100],i,temp,n;
    scanf ("%d\n",&n);
    for (i=1;i<=n;i++)
    {
    scanf("%d",&a[i]);    
    }
    for(i=1;i<=n/2;i++)
    {
       temp=a[i];
       a[i]=a[n+1-i];
       a[n+1-i]=temp;   
    }
    for(i=1;i<n;i++)
    {
    printf("%d ",a[i]);                 
    }
    printf("%d",a[n]);
    return 0;
}
void get(int);
int i=1;
int main()
{   
	int n;
	cin>>n;
	get(n);
	return 0;
}
void get(int n)
{
  int a,m;
  cin>>a;i++;
  if(i<n)get(n);
  else if(i==n){cin>>m;cout<<m;}
  cout<<" "<<a;  
}
int main(void)
{
	int a[100],n;
	cin >>n;
	for (int i=0;i<=n-1;i++)
	{
		cin >>a[i];
	}
	for (int i=n-1;i>=0;i--)
	{
		cout <<a[i];
		if (i!=0) cout <<" ";
	}
	return 0;
}
int main()
{
    int i, j, n;
    int a[100];
    /* ???? */
    scanf("%d", &n);
    for (i=0; i<n; i++) {
        scanf("%d", &a[i]);
    }
    /* ???? */
    for (i=0,j=n-1; i<j; i++,j--) {
        int t = a[i];
        a[i] = a[j];
        a[j] = t;
    }
    /* ???? */
     for (i=0; i<n; i++){ 
               printf("%d", a[i]);
			   if(i!=n-1) printf(" ");
    }
            return 0;
}
/*
 * ????reverse.cpp
 * ?????1200012840
 * ?????2012-12-13
 * ????????????????????????????8,6,5,4,1?????1,4,5,6,8?
 */



int main()
{
	int n,i,a[102],*p=NULL,*q=NULL,temp;//????
	cin>>n;//??
	for(i=0;i<n;i++)//????
		cin>>a[i];
	for(p=a,q=a+n-1;p<q;p++,q--)//??????
	{
		temp=*p;
		*p=*q;
		*q=temp;
	}
	for(p=a;p<(a+n-1);p++)//??
		cout<<*p<<' ';
	p=a+n-1;
	cout<<*p<<endl;
	return 0;//????
}
int main()
{
	int a[200],n,i;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		a[2*n+1-i]=a[i];
	}
	for(i=1;i<n;i++)
		cout<<a[n+i]<<" ";
	cout<<a[2*n]<<endl;
	return 0;
}
int main()
{
	int i, n, a[110]={0};
	int *p=a;							//????????
	cin >> n;
	for (i=0; i<n; i++)
		cin >> *(p+i);					//?????*(p+i)???????????
	for (i=n-1; i>0; i--)
		cout << *(p+i) << ' ';			//????????
	cout << *p << endl;
	return 0;							//main???????0
}
int main()
{
	int a[100],n,i,count=0;
	int *pt=a;
	scanf("%d",&n);
	for(i=0;i<n;i++,pt++)
		scanf("%d",pt);
	for(i=n-1;i>=0;i--)
	{
		if(count==0)
		{
			printf("%d",*(a+i));
			count++;
		}
		else
			printf(" %d",*(a+i));
	}
	printf("\n");
	return 0;
}
void main()
{
	int i,a[100],b[100],n;
	scanf("%d",&n);
	i=1;
	while (i<=n)
	{
		scanf("%d",&a[i]);
		i=i+1;
	}
	i=1;
	while (i<=n)
	{
		b[n+1-i]=a[i];
		i=i+1;
	}
	i=1;
	while (i<=n-1)
	{
		printf("%d ",b[i]);
		i=i+1;
	}
    printf("%d",b[i]);
}
int main()
{
	int i=0,n=0,a[1000]={0};
	int *p=a;
	cin>>n;
	for(i=0;i<n;i++)
		cin>>*p++;//????
	for(p=a+n-1;p>a;p--)
		cout<<*p<<" ";
	cout<<*p;//????
	return 0;
}
int main()
{
	int n,i,j,k,t;
	int a[101];
	cin>>n;
	for(i=1;i<=n;i++)
		cin>>a[i];
	if(n%2==0)
	{
		k=n/2;
        for(i=1;i<=k;i++)
		{
			t=a[n+1-i];
			a[n+1-i]=a[i];
			a[i]=t;
		}
	}
	else if(n%2!=0)
	{
		k=(n-1)/2;
        for(i=1;i<=k;i++)
		{
			t=a[n+1-i];
			a[n+1-i]=a[i];
			a[i]=t;
		}
	}
	for(i=1;i<=n-1;i++)
		cout<<a[i]<<" ";
	    cout<<a[n];
   
return 0;
}
//??????
int main()
{
    int n=0,i=0,j=0;
    int a[10000]={0};
    int *p=a;
    cin>>n;
    for (i=0;i<n;i++)
        cin>>a[i];
    for (i=0;i<n/2;i++)
    {
        j=*(p+i);
        *(p+i)=*(p+n-1-i);
        *(p+n-1-i)=j;
    }
    for (i=0;i<n;i++)
    {
        if (i!=n-1)
            cout<<a[i]<<" ";
        if (i==n-1)
            cout<<a[i];
    }
    return 0;
}
int main(int argc, char* argv[])
{
	int i,n,t;
	int *p;
	p=(int *)malloc(sizeof(int)*100);
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d",&t);
        *(p+i)=t;
	}
	printf ("%d",*(p+n-1));
	for (i=n-2;i>=0;i--)
	{
		printf(" %d",*(p+i));
	}
	free(p);
	return 0;
}
int main()
{
	int n,a[100],i;
	int *p; 
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	p=&a[0];
	for(i=0;i<n;i++)
	{
		if(i<n-1)
		printf("%d ",*(p+n-i-1));
		else
		printf("%d",*(p+n-i-1));
	}
	return 0;
}
int a[110],m;
void f(int n)
{
   
    if(n==1)
   {
            cout<<a[m-1];
        
        
    }
   else
   {
       f(n-1);
      cout<<" "<<a[m-n];
   }
}
int main()
{
    
    cin>>m;
    for(int i=0;i<m;i++)
    {
        cin>>a[i];
        
    }
   f(m);
    
 
 
 


return 0; }
int  main( )
{
   int a[1000];
   int n,i;
   scanf ("%d",&n);
   for(i=0;i<n;i=i+1)
   {
	   scanf ("%d",&a[i]);
   }
   for(i=0;i<n;i=i+1)
   {
	   if (i==0)
	   printf("%d",a[n-1]);
	   else
		   printf(" %d",a[n-1-i]);
   }
return 0;
}
int main(int argc, char* argv[])
{
	int n,i,b;
	scanf("%d",&n);
	int a[1000];
	for(i=1;i<=n;i++)
	{
		scanf("%d",&b);
		a[i]=b;
	}
	for(i=n;i>1;i--)
	{
		b=a[i];
		printf("%d ",b);
	}
	b=a[1];
	printf("%d",b);
	return 0;
}
int main(int argc, char* argv[])
{
	int n,a[100],i,j,m=0;
	scanf ("%d",&n);
    for (i=0;i<=n-1;i++)
	{
		scanf ("%d",&a[i]);
		m++;
	}
	for (j=m-1;j>0;j--)
		printf ("%d ",a[j]);
         printf ("%d",a[0]);
	return 0;
}
void main()
{
	int *a,i,j,k,m,n,*p;
	scanf("%d",&n);
	a=(int *)malloc(n*sizeof(int));
	p=(int *)malloc(n*sizeof(int));
	for(i=0;i<n;i++)
		scanf("%d",(a+i));
	
	for(i=n-1,j=0;i>-1,j<n;i--,j++)
		*(p+j)=*(a+i);
	printf("%d",*p);
	for(j=1;j<n;j++)
		printf(" %d",*(p+j));


}
int main()
{
    int n,i,a[100]={0};
    int *point;
    cin>>n;
    for(i=0;i<n;i++)
     cin>>a[i];
    point=&a[n-1];        //point???????? 
    for(i=0;i<n-1;i++)
     cout<<*point--<<' ';//????
    cout<<*point;
    return 0;
}
int main()
{
	int n,a[120],i,temp;
	int *p = NULL;//????
	p = a;
	cin >> n;
	for ( i = 0 ; i < n; i ++ )  cin >> *(p + i);
	for ( i = 0 ; i < n / 2 ; i ++ )//?????
	{
		temp = *(p + i);
		*(p + i) = *(p + n - 1 - i);
		*(p + n - 1- i ) = temp;
	}
	cout << a[0];
	for ( i = 1 ; i < n; i ++) cout << ' ' << *(p + i);
	return 0;
}
int main()
{
	int n,i,m[100],t=0,j;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&m[i]);
	for(i=0;i<n/2;i++)
	{
		j=n-i-1;
		t=m[i];
		m[i]=m[j];
		m[j]=t;
	}
	printf("%d",m[0]);
	for(i=1;i<n;i++)
		printf(" %d",m[i]);
	return 0;
}
int main()
{
    int sz[max],a[max];
    int n,i,k;
    scanf("%d\n",&n);
    for(i=1;i<=n;i++){
        scanf("%d ",&(sz[i]));
    }
    for(k=1;k<n;k++){
        a[k]=sz[n-k+1];
        printf("%d ",a[k]);
    }
    a[n]=sz[1];
    printf("%d",a[n]);
    return 0;
}
int main(void)
{
int arr[100], n;
int i;
scanf("%d",&n);
for(i=0;i<n;++i)
scanf("%d",&arr[i]);
for(i=0;i<n/2;++i)
{
arr[i]^=arr[n-i-1];
arr[n-i-1]^=arr[i];
arr[i]^=arr[n-i-1];
}
for(i=0;i<n;++i)
{
printf("%d",arr[i]);
if(i!=n-1)
printf(" ");
}
return 0;
}
void main()
{
	int i,j,n,*num,t;
	scanf("%d",&n);
	t=n/2;
	num=(int*) malloc (sizeof(int)*n);
	for (i=0;i<n;i++)
		scanf("%d",&num[i]);
	for (i=0;i<t;i++)
	{
		j=num[i];
		num[i]=num[n-1-i];
		num[n-1-i]=j;
	}
	for (i=0;i<n;i++)
	{
		printf("%d",num[i]);
		if(i<n-1) printf(" ");
	}
	free(num);
}
void swap(int * a,int *b){
    int * ch;
    ch=a;
    a=b;
    b=ch;
}

int main(){
    int n,line[150];
    
    cin>>n;
    for (int i=0; i<n; i++) {
        cin>>line[i];
    }
    int * p_1=line;
    for (int i=0; i<=((int)n/2)-1; i++) {
        swap(*(p_1+i), *(p_1+n-i-1));
    }
    cout<<* (p_1);
    for (int j=1; j<n; j++) {
        cout<<' '<<* (p_1+j);
    }
    return 0;
}
int main()
{
    int n=0,t=0,i=0,j=0,k=0;
    int num[100];
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>num[i];
    }
    for(k=1;k<=n;k++)
       for(j=1;j<=n-k;j++)
        {
            t=num[j];num[j]=num[j+1];num[j+1]=t;
        }
    for(i=1;i<n;i++)
    cout<<num[i]<<" ";
    cout<<num[n]<<endl;
    return 0;
}
int main()
{
	int n;
	scanf("%d",&n);
	int sz[99],zs[99];
	for(int i=0;i<n;i++)
	{
		scanf("%d",&(sz[i]));
		zs[n-i-1]=sz[i];
	}
	for(int j=0;j<(n-1);j++)
	{
		printf("%d ",(zs[j]));
	}
	printf("%d",(zs[n-1]));
	return 0;
}
int n, a[101];
int *p1, *p2, *p3;
int main()
{
    cin >> n;
    for (p2 = a; n --; ++ p2)//??n??????*p2?????
        cin >> *p2;
    p3 = p2;
    for (p1 = a, -- p2; p1 < p2; ++ p1, -- p2)//*p1??*p2???????
    {
        n = *p1;
        *p1 = *p2;
        *p2 = n;
    }
    cout << *a;
    for (p1 = a + 1; p1 < p3; ++ p1)
        cout << " " << *p1;
    return 0;
}
void main()
{
	int n,a[100],*p,*j,i,temp;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	for(p=a,j=a+n-1;p<a+n/2;p++,j--)
	{
		temp=*p;
		*p=*j;
		*j=temp;
	}
	for(p=a;p<a+n-1;p++)
		printf("%d ",*p);
	printf("%d",*p);

}
//
//  main.cpp
//  nixu
//
//  Created by blues cookie on 12-12-9.
//  Copyright (c) 2012? blues cookie. All rights reserved.
//

int main(int argc, const char * argv[])
{
    int n,i,j,k;
    cin>>n;
    int a[n+3];
    int *p=a;
    for(i=0;i<n;i++) cin>>a[i];//????
    for(i=0;i<n/2;i++)//??
    {
        j=*(p+i);
        *(p+i)=*(p+n-i-1);
            *(p+n-i-1)=j;
    }
    for(i=0;i<n-1;i++) cout<<*(a+i)<<' ';
    cout<<*(a+n-1);
    return 0;
    
}
int main()
{
	int n,i,a[100],t,half;//a[100]????????t?????,half?????
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	if(n%2==0)
		half=n/2;
	else
		half=(n-1)/2;
for(i=0;i<half;i++)
{ 
	t=a[i];
	a[i]=a[n-i-1];
	a[n-1-i]=t;
}//????
for(i=0;i<n-1;i++)
{
	cout<<a[i]<<" ";
}
   cout<<a[n-1]<<endl;
	return 0;
}
/*
 * ????reverse-rank-of-int.cpp
 * ??????
 * ????:2012-12-14
 * ???????
 */
int main(){
	int n=0,temp=0,A[100]={0};         //????n,temp???A
	cin>>n;                            //???????n
	for(int i=0;i<n;i++)cin>>*(A+i);   //??????n??
	for(int *p=A,*q=A+n-1;p<q;p++,q--) //???????????????
	{
		temp=*p;
		*p=*q;
		*q=temp;
	}
	cout<<*A;                          //??????????????????
	for(int i=1;i<n;i++)cout<<" "<<*(A+i);
	return 0;                          //?????
}