semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(int argc, char* argv[])
{
	int n,i;
	scanf("%d",&n);
	int m[NUMBER];
	for(i=0;i<n;i++){
	scanf("%d",&m[i]);
	}
	int q;
	printf("%d",m[n-1]);
	for(q=n-2;q>=0;q--){
	printf(" %d",m[q]);
	}
	return 0;
}
int main()
{
    int *p=NULL;
    int n; 
    int init[100];
    cin>>n;
    cin>>init[0];
    p=&init[0];
    
    for(int i=1; i<n ;i++)
    cin>>*(p+i);
    
    for(int i=1;i<n;i++)
    cout<<*(p+n-i)<<' ';
    cout<<*p;
    
    
    return 0;
}
int main()
{
	int n,i;
	cin>>n;//??n
	int a[n+1];
	int *p=NULL;
	p=&a[0];
	for(i=0;i<n;i++)
	{
		cin>>*(p+i);//????
	}
	cout<<*(p+n-1);//???????
	for(i=n-2;i>=0;i--)
	{
		cout<<' '<<*(p+i);//?????????
	}
	return 0;
}
void invert(int ip[],int n)
{
    
    int i;
    int s=1;
    
    for(i=0;i<n;i++)
    {
        if(s==1){printf("%d",ip[n-1-i]);s=0;}
        else{printf(" %d",ip[n-1-i]);}
        
    }
    return;
    
}

int main() {

    int n;
    scanf("%d",&n);
    int ip[n];
    int i;
    for(i=0;i<n;i++)
    {
        scanf("%d",&(ip[i]));
    }
    invert(ip,n);
    
    return 0;
}
int print();
int main()
{
	int m;
	char c;
	cin>>m;
	c=cin.get();
	print();
	return 0;
}
int print()
{
	int a;
	char c='\0';
	cin>>a;
	c=cin.get();
	if(c!='\n')
		print();
	if(c!='\n')
		cout<<c;
	cout<<a;
	return 0;
}
void Exchange(int A[],int n);

int main(){
    int n;
    scanf("%d",&n);
    int A[n];
    Exchange(A,n);
    return 0;
}


void Exchange(int A[],int n){
    for(int i=0;i<n;i++){
        scanf("%d",&A[i]);
    }
    printf("%d",A[n-1]);
    for(int j=n-2;j>=0;j--){
        printf(" %d",A[j]);
    }
}
int main()
{
	int a[100];
	int n,i,j,k,s=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
      scanf("%d",&a[i]);
	}
	for(j=0;j<n-1;j++)
	{
		for(i=0;i<n-1-j;i++)
		{
			
				k=a[i];
				a[i]=a[i+1];
				a[i+1]=k;
			

		}
	}
	for(i=0;i<n;i++)
	{
		if(s==0)
		{
           printf("%d",a[i]);
		   s=1;
		}
		else
			printf(" %d",a[i]);
	}
		return 0;
}
int a[10000];
int p;
void oppo(int n);
void printa(int n);
int main(){
	int n;
	scanf("%d",&n);
	oppo(n);
	printa(n);
	return 0;
}

void oppo(int n){
	for(int i1=0;i1<n;i1++){
		scanf("%d",&(a[i1]));
	}
	for(int i2=0;i2<n;i2++){
		for(int j=0;j<n-i2-1;j++){
			p=a[j];a[j]=a[j+1];a[j+1]=p;
		}
	}
}

void printa(int n){
	for(int i3=0;i3<n;i3++){
		if(i3==0){
			printf("%d",a[i3]);
		}else{
		printf(" %d",a[i3]);
		}
	}
}
int main()
{
   int n,i;
   int a[300],b[300];
   int *p,*p1;
   p=a;
   p1=b;
   scanf("%d",&n);
   for(i=0;i<n;i++)
   {  scanf("%d",p);
      *p1=*p;
	  p1++;
      p++;
   }
   p=a;
   p1=b;
   i=0;
   for(i=0;i<n;i++,p++)
   { *p=*(p1+n-1-i);
   }
  p=a;
   printf("%d",*p);
   for(i=1;i<n;i++)
	   printf(" %d",*(++p));

	return 0;
}
int main()
{
	int n,a[100],*p;
	for(p=a,cin>>n;p<=a+n-1;++p)
		cin>>*p;
	p=p-1;
	cout<<*p;
	for(p=p-1;p>=a;--p)
		cout<<" "<<*p;
	return 0;
}
int main(void)
{
int i,n;
scanf("%d\n",&n);
int num[n];
for(i=0;i<n;i++)
scanf("%d",&num[i]);
for(i=1;i<n;i++)
printf("%d ",num[n-i]);
printf("%d",num[0]);
return 0;
}
void main()
{
	int a[100],n,i,*j,*k,*p,temp,m;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%d",a+i);
    m=(n-1)/2;
	j=a;k=a+n-1;p=a+m;
	for(;j<=p;j++,k--)
	{temp=*j;
	*j=*k;
	*k=temp;
	}
    for(i=0;i<n-1;i++)
	printf("%d ",*(a+i));
    printf("%d",*(a+n-1));
}
int main(int argc, char* argv[])
{
	int a[100],b[100],i,n;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		b[i]=a[i];
	}
	for(i=0;i<n;i++){
		a[i]=b[n-i-1];
	}
	printf("%d",a[0]);
	for(i=1;i<n;i++){
	printf(" %d",a[i]);
	}
	return 0;
}
int main()
{
    int n,i;
    scanf("%d\n",&n);
    int a[100],b[100];
    for(i=0;i<n;i++)
    {
        scanf("%d ",&a[i]);
    }
    for(i=0;i<n;i++)
    {
        b[i]=a[n-i-1];
    }
    for(i=0;i<n-1;i++)
    {
        printf("%d ",b[i]);
    }
    printf("%d",b[n-1]);
    return 0;
}
int main()
{
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
       {
           cin>>a[i];
       }
    if(n==1)  cout<<a[0]<<endl;//???????
    else
        {
            cout<<a[n-1];//???????
            for(int i=n-2;i>=0;i--)
               {
                   cout<<" "<<a[i];//???????????????
               }
        }
        return 0;
}
int main()
{
	int n;                                //n????????
	int shun[100];int ni[100];            //shun?????,ni?????
	cin>>n;
	for(int i=0;i<n;i++)                  //??????????
	{
		cin>>shun[i];
	}
	for(int j=0;j<n;j++)                  //????????????????
	{
		ni[j]=shun[n-1-j];
	}
	cout<<ni[0];                          //??ni??
	for(int k=1;k<n;k++)
	{
		cout<<' '<<ni[k];
	}
	return 0;
}
void main()
{
	int n,a[100],*p=a;
	scanf("%d",&n);
	p=p+n-1;
	for(;p>=a;p--)
		scanf("%d ",p);
	p=a;
	for(p=a;p<a+n-1;p++)
		printf("%d ",*p);
                  printf("%d",*p);
}
int main ()
{
    int i,n;
    scanf("%d",&n);
    int q[100];
    for(i=0;i<n;i=i+1){
        scanf("%d",&(q[i]));
    }
    for(i=n-1;i>=1;i=i-1){
    printf("%d ",q[i]);
    }
    printf("%d",q[0]);
    return 0;
}
void main()
{int i,j,*p,a[100]={0},n,t=0;
scanf("%d",&n);
for(p=a;p<n+a;p++)
scanf("%d",p);
p=a;
for(i=0;i<n-1;i++)
{t=*(a+n-1);
for(p=a+n-1;p>=a+i+1;p--)
{*p=*(p-1);}
*(a+i)=t;
}
printf("%d",*a);
for(p=a+1;p<(a+n);p++)
printf(" %d",*p);
}
/*
 *???: reverse_array.cpp
 *??: ???
 *????: 2012-12-09
 *??: ????
 */



int main()
{
	int n;
	int array[MAXN];
	int *begin,*end; //??????

	cin >> n;
	for (int i=0;i<n;i++)
		cin >> array[i];
	begin=array; end=array+n-1;
	while (begin<end){
		int tmp = *begin;
		*begin = *end;
		*end = tmp;
		begin++;
		end--;
	}
	for (int i=0;i<n;i++){
		if (i) cout << ' ';
		cout << array[i];
	}
	cout << endl;
	return 0;
}
/*
 * daoxu.cpp
 *
 *  Created on: 2012-10-30
 *      Author: Administrator
 */

int main() {
	int n, i, a[150], b[150];//??,i?????,a[]?????,b[]?????
	cin >> n;
	for (i = 0; i < n; i++)
		cin >> a[i];//??????a[]?
	for (i = 0; i < n; i++)
		b[i] = a[n - 1 - i];//??????????
	for (i = 0; i < n; i++)
		a[i] = b[i];//????????
	cout << a[0];
	for (i = 1; i < n; i++)
		cout << " " << a[i];//????
	return 0;//????

}
int main()
{
	int n=0,i;
	int a[105]={0};
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];

	for(i=n-1;i>=1;i--)
		cout<<a[i]<<" ";

	cout<<a[0];


return 0;




}
int main()
{
	int n,i,p;//??????n,i,p
	cin>>n;//??n
	int a[n+1];//??????
	for(i=1;i<=n;i++)//??
	{
		cin>>a[i];//??a[i]
	}
	if(n%2==0)//?n???
	{
		for(i=1;i<=n/2;i++)//i?1????i<=n/2,??????
		{
			p=a[i];//?a[i]?a[n-i+1]??
			a[i]=a[n-i+1];
			a[n-i+1]=p;
		}
	}
	else//?n???
	{
		for(i=1;i<=(n-1)/2;i++)//i?1????i<=?n-1?/2,??????
		{
			p=a[i];//?a[i]?a[n-i+1]??
			a[i]=a[n-i+1];
			a[n-i+1]=p;
		}
	}
	for(i=1;i<=n;i++)//??
	{
		if(i==1)//?i=1
			cout<<a[i];//??a[i]
		else//??
			cout<<' '<<a[i];//???????a[i]
	}
	return 0;
}
void main()
{
	int a[100],b[100],n,i,*p,*q;
	scanf("%d",&n);
	for(p=a;p<a+n;p++)
		scanf("%d",p);
	q=b;
	p--;
	for(i=0;i<n;i++)
		*q++=*p--;
	q=b;
	for(i=0;i<n-1;i++)
		printf("%d ",*q++);
	printf("%d",*q);
}
int main()
{
	int a[100];
	int n;
	int *p=a;
	cin>>n;
	for(;p<a+n;p++)
		cin>>*p;
	for(p=a+n-1;p>a;p--)
		cout<<*p<<" ";
	cout<<*p;

}
void main()
{
   int n,a[100],t,*p=a,*q;
   scanf("%d",&n);
   for(;p<a+n;p++)
   scanf("%d",p);
p=a;q=a+n-1;
for(;p<q;p++,q--)
{  t=*p;
  *p=*q;
*q=t;}
for(p=a;p<a+n-1;p++)
printf("%d ",*p);
printf("%d",*p);
}
int main()
{
	int i,j,k,m,n,u;
	int a[100],b[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{scanf("%d",&a[i]);}
	for(j=0;j<n;j++)
	{
		b[j]=a[n-1-j];
	}
	for(m=0;m<n;m++)
	{
		printf("%d",b[m]);
		if(m<n-1)
		{
			printf(" ");
		}
	}
return 0;
}
int main()
{
	int a[50],n,i,j,med;
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	for(j=0;j<n/2;j++)
	{
		med=a[j];
		a[j]=a[n-j-1];
		a[n-j-1]=med;
	}
	for(i=0;i<n-1;i++)
		cout<<a[i]<<' ';
	cout<<a[n-1];
	cout<<endl;
	return 0;
}
main()
{
	int n,i,num[100],*p;
	p=num;
    scanf("%d",&n);
    for(i=0;i<n;i++)
		scanf("%d",&num[i]);
	sort(n,p);
    for(;p<num+n-1;p++)
		printf("%d ",*p);
       printf("%d",*p);
}
void sort(int m,int *p1)
{
	int i,t;
  for(i=0;i<m/2;i++)
	 { t=*(p1+i);
      *(p1+i)=*(p1+m-1-i);
      *(p1+m-1-i)=t;}
}
int main()
{
    int n,i,j,p,num,q;//????????n?????i?j?p ?q??????num 
    cin>>n;
    int a[100];//?????100???a 
    for(i=1;i<=n;i++)//???? 
    {
                     cin>>num;
                     a[i]=num;
    }
    p=(n-n%2)/2;
    for(i=1;i<=p;i++)//???? 
    {
                     q=a[n+1-i];
                     a[n+1-i]=a[i];
                     a[i]=q;//?????????? 
    }
    for(i=1;i<=n;i++)//???? 
    {
                     if(i!=n)
                     cout<<a[i]<<" ";
                     else
                     cout<<a[i];
    }
    return 0;
}
int main()
{
	int n;cin>>n;
	int a[n];int tr,i;
	for( i=0;i<n;i++)cin>>a[i];
	i--;
	for(int j=0;j<i;j++,i--)
	{
		tr=a[j];a[j]=a[i];a[i]=tr;
	}
	for( i=0;i<n;i++){
		if(i==0)cout<<a[i];
		else cout<<" "<<a[i];
	}
return 0;
}
int main(){
    int i, n, a[MAX];
    scanf("%d", &n);
    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[0]);
}
int main(){
	int n,a[100];
	cin>>n;
    int i;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	int j;	
	for(j=n-1;j>=0;j--){
		cout<<a[j];
		if(j!=0)
			cout<<" ";
	}
	return 0;
}
void main()
{
 int n,i,m,t;
 int a[100];
 scanf("%d",&n);
 for(i=0;i<n;i++)
  {
    scanf("%d",&m);
    a[i]=m;
   }
for(i=0;i<=(int)(n-1)/2;i++)
  {
  t=a[i];
  a[i]=a[n-i-1];
  a[n-i-1]=t;
  }
  for(i=0;i<n;i++)
  { 
 printf("%d",a[i]);
   if(i<n-1)
 printf(" ");
   }
}
int main()
{
	int i,n,a[100];
	scanf("%d",&n);
    for(i=0;i<n;i++)
	{
		scanf("%d",&a[n-1-i]);
	}
	for(i=0;i<n;i++)
	{
	    if(i==n-1)
		printf("%d",a[i]);
		else
			printf("%d ",a[i]);
	}
	
	return 0;
}
//**************************************************
//*??????????.cpp                        *
//*??????                                    *
//*?????2011.10.26                            *
//*???????????                          *
//**************************************************

int main()
{
	int n=0,i=0,j=0; int num[100]; //??????n???????????????0???????i,j??????0???????num,????????
	cin>>n;
	for(i=0;i<n;i++) //????????
	{
		cin>>num[i];
	}
	j=n-1; //?????
    do
	{	cout<<num[j];
	    if(j>0)
		{
			cout<<" ";
		}
		j--;
	}while(j>=0);
	return 0;
}
int main(){
     int x,n,a[100];
     int *p,*q;
       cin>>n;
        for (p=a;p<a+n;p++)
        	cin>>*p;
       for (p=a,q=a+n-1;p<q;p++,q--)
        {x=*p;
         *p=*q;
         *q=x;
         }
       for (p=a;p<a+n;p++)
    	    {if (p>a) cout<<' ';
    	     cout<<*p;
    	    }
     return 0;
}
/*
 * ????.cpp
 * ??????????????
 *  Created on: 2012-11-16
 *      Author: ???
 */
int main()
{
	int a[101],i,n,temp;
	cin>>n;
	for(i=1;i<=n;i++){
		cin>>a[i];                   //???????
	}
	if(n%2==0){                      //??????????
		for(i=n/2+1;i<=n;i++){       //????????????????
			temp=a[i];
			a[i]=a[n-i+1];
			a[n-i+1]=temp;
		}
	}
	else{
		for(i=(i+1)/2;i<=n;i++){    //??????????????????????????
			temp=a[i];
			a[i]=a[n+1-i];
			a[n+1-i]=temp;
		}
	}
	cout<<a[1];
	for(i=2;i<=n;i++){
		cout<<' '<<a[i];          //??????????
	}
}
/*??? 1200012866
2012.9.28
????*/
int main()
{
	int n;
	cin>>n;
	int a[100],r;
	float n2;
	if(n%2==0)
		n2=n/2;
	else
		n2=(n-1)/2;
	for(int j=0;j<n;j++) cin>>a[j];
	for(int i=0;i<n2;i++)
	{
		r=a[i];
		a[i]=a[n-i-1];
		a[n-i-1]=r;
	}
	for(int j=0;j<n-1;j++) cout<<a[j]<<" ";
	cout<<a[n-1];

return 0;
}
int main()


{

	int i,n,j,t,a[100]={0};

	cin>>n;
	
	for(i=0;i<=n-1;i++)

		cin>>a[i];

	for(i=0;i<=(n-1)/2;i++)

	{
		
		t=a[i];

		a[i]=a[n-i-1];

		a[n-i-1]=t;

	}

	for(j=0;j<=n-2;j++)

		cout<<a[j]<<" ";

	cout<<a[n-1];

return 0;

}
/*
 *???redo.cpp
 *????????
 *????: 2012-12-10
 *?????1200012825
 */

int main(void)
{
	int n;
	cin>>n;
	int *p=NULL,a[100],*q=NULL;
	for(q=a;q<=a+n-1;q++){
		cin>>*q;//??
	}
	cout<<*(p=a+n-1);
	for(p=a+(n-2);p>=a;p--){
		cout<<" "<<*p;//????
	}
	return 0;
}
int main()
{
	int a[100],b[100],n,i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	for(i=0;i<n-1;i++)
	{
		b[i]=a[n-1-i];
		printf("%d ",b[i]);
	}
	printf("%d",a[0]);
	return 0;
}
int main(){ 
    int sz[100];
    int n,e,m,k;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
            scanf("%d",&sz[i]);
            }
    m=n-1;
    k=0;
    while(k<m){
                e=sz[k];
                sz[k]=sz[m];
                sz[m]=e;
                k+=1;
                m-=1;
                }
    for(int i=0;i<n-1;i++){
            printf("%d ",sz[i]);
            }
    printf("%d",sz[n-1]);

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


return 0;
}
int main() {
    int n,a[100],temp=0;         //????
    cin>>n;
    int *p=NULL,*q=NULL;          //??????p?q?????
    for(p=a;p<a+n;++p)        //??????
    	cin>>*p;
    for(p=a,q=a+n-1;p<q;++p,--q)         //????
    {
    	temp=*p;
    	*p=*q;
    	*q=temp;
    }
    p=a;
    cout<<*p;              //?????
    for(p=a+1;p<a+n;++p)
    	cout<<' '<<*p;
	return 0;
}
int main()
{
   int i,a[100];
   int n;
   scanf("%d\n",&n);
   for(i=0;i<n;i++){
   scanf("%d ",&a[i]);
}

   for(i=n-1;i>=1;i--){
   printf("%d ",a[i]);
}
   for(i=0;i>=0;i--){
   printf("%d",a[i]);
}

   return 0;
}
/*
 * shuzunixuzhi.cpp
 *???????????
 *  Created on: 2012-12-17
 *      Author: ??
 */

int main() {
	int a[101];
	int i, n, *p = a;//??
	cin >> n;//??
	for (i = 0; i < n; i++)
		cin >> *(p++);//????
	p = a;
	for (i = 0; i < n / 2; i++)
		swap(*(p + i), *(p + n - i - 1));//??
	cout << *(p++);//??
	n--;
	while (n > 0) {
		cout << " " << *(p++);
		n--;//??????
	}
	return 0;
}
void main()
{
	int a[100],n,i,flag=0;
	int *pt;

	scanf("%d",&n);

	pt=a;

	for(i=0;i<=n-1;i++)
	{
		scanf("%d",pt+i);
	}

	for(i=n-1;i>=0;i--)
	{
		if(flag==0)
		{	printf("%d",*(pt+i));
		flag=1;}
		else
			printf(" %d",*(pt+i));
	}
}
int main()
{
    int i;
    int n;
    int buf;
    int *array;
    scanf("%d", &n);
    array = (int *)malloc(n * sizeof(int));
    for (i = 0; i < n; i++) {
        scanf("%d", array + i);
    }
    for (i = n - 1; i >= 0; i--) {
        if (i != n - 1) {
            printf(" ");
        }
        printf("%d", *(array + i));
    }
    return 0;
}
int main()
{
	int sz[100],n,i,m,j;
	scanf("%d",&n);
    for(i=0;i<n;i++)
	{
		scanf("%d",&sz[i]);
	}
	int *pi=sz;
	int *pj=sz+n-1;
	for(;pi<pj;pi++,pj--)
	{
		m=*pi;
		*pi=*pj;
		*pj=m;
	}
	for(j=0;j<n-1;j++)
	{
		printf("%d ",sz[j]);
	}
	printf("%d",sz[n-1]);
	return 0;
}
void main()
{
	int n,i,a[100];
	int *p;
	p=a;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",p+i);
	for(i=n-1;i>0;i--)
		printf("%d ",*(p+i));
	printf("%d\n",*p);
}
int a[100]={0};
int f(int i,int t)
{
     cin>>a[i];//i?????? 
     if(i<t) 
     {
        f(i+1,t);
     }//?????????????????? 
     if(i==1) cout<<a[i];
     else cout<<a[i]<<' ';
}
int main()
{
     int t,i=1;
     cin>>t;
     f(i,t); 
     return 0;
}
int main()
{
	int n;
	scanf("%d",&n);
	int i,u,a[100];
	for(i=0;i<=n-1;i++){
		scanf("%d",&u);
		a[n-1-i]=u;
	}
	printf("%d",a[0]);
	for(i=1;i<=n-1;i++){
		printf(" %d",a[i]);	
	}
	return 0;
}
int n,inp[MAX],oup[MAX],i;
int main(){
    scanf("%d",&n);
    for(i=0;i<=n-1;i++){
        scanf("%d",&inp[i]);
    }
    for(i=0;i<=n-1;i++){
        oup[i]=inp[n-1-i];
    }
    for(i=0;i<n-1;i++){
        printf("%d ",oup[i]);
    }
    printf("%d",oup[n-1]);
    return 0;
}
int main(){
int n,a;
scanf("%d ",&n);
int sz[n];
for(int i=0;i<n;i++){
scanf("%d",&sz[i]);
}
for(int k=0;k<(n/2);k++){
a=sz[n-1-k];
sz[n-1-k]=sz[k];
sz[k]=a;
}
for(int k=0;k<n-1;k++){
	printf("%d ",sz[k]);
}
printf("%d",sz[n-1]);
return 0;
}
void main()
{
	struct number
	{
		int num;
		struct number * next;
	};
	struct number * head=0,* p;
	int n,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		p=(struct number *)malloc(sizeof(struct number));
		scanf("%d",&p->num);
		if(i==1)p->next=0;
		else p->next=head;
		head=p;
	}
	if(head!=0)
	{
		for(i=1;i<=n;i++)
		{
			printf("%d",p->num);
			if(i<n)printf(" ");
			else printf("\n");
			p=p->next;
		}
	}
}
int main()

{
	int shuzu[Row][Len];
	int i,n;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&shuzu[0][i]);
	}
	int j,r;
		r=0;
	for(j=n-1;j>=0;j--){

		shuzu[1][r]=shuzu[0][j];
		r++;
	}
	for(r=0;r<n-1;r++){
	printf("%d ",shuzu[1][r]);
	}
	printf("%d",shuzu[1][n-1]);
	return 0;
}
int main()
{
  int n,i,q;
  scanf("%d", &n);
  int a[100];
  for(i=1;i<=n;i++){
	 scanf("%d", &a[i]);
  }
  for(q=n;q>1;q--){
  printf("%d", a[q]);
  printf(" ");
  }
  printf("%d", a[1]);
			return 0;
}
int main()
{
	int n,a[100];
	int i;
	for(i=0;i<100;i++)
		a[i]=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	for(i=n;i>=1;i--)
	{
		if(i>1)
			printf("%d ",a[i]);
		else
			printf("%d",a[i]);
	}
	return 0;
}
int main()
{
	int n,e,sz[100];
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&sz[i]);
	}
	for(int k=1;k<=n;k++){
	for(int i=0;i<n-k;i++){
		e=sz[i];
		sz[i]=sz[i+1];
		sz[i+1]=e;
	}
	}
	for(int j=0;j<n;j++){
		if(j<n-1)
			printf("%d ",sz[j]);
		else
			printf("%d",sz[j]);
	}
	return 0;
}
int main(int argc, char* argv[])
{
	int yuan[100];
	int xin[100];
	int n,i,j;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d",&yuan[i]);
	for(i=1;i<=n;i++)
	{
       j=n-i+1;
	   xin[j]=yuan[i];
	}
	printf("%d",xin[1]);
	for(j=2;j<=n;j++)
	printf(" %d",xin[j]);
	return 0;
}
int a[110];
int main()
{
 int n,i;
 scanf("%d",&n);
 for(i = 1;i <= n;i ++)
   scanf("%d",&a[n-i]);
 for(i = 0;i < n - 1;i ++)
   printf("%d ",a[i]);
 printf("%d",a[n-1]);

return 0;
}
int main()
{
    int a[100],i,k,n;
    scanf("%d",&n);
    for(i=0;i<n;i++){
                     scanf("%d",&a[i]);
                     }
    for(i=n-1;i>0;i--){
                        printf("%d ",a[i]);
                       }
                     a[0]=a[0];
                    printf("%d",a[i]);
    return 0;
}
const int maxn=100;	
int main()
{
	int i=0,x=1,n=0;
	int a[maxn];
	cin>>n;
    for(int j=0;j<=n-1;j++)
		cin>>a[j];
    while(i<(n+1)/2)
	{   x=a[i];
		a[i]=a[n-1-i];
		a[n-1-i]=x;
		i++;
	}
    for(int k=0;k<=n-2;k++)
             cout<<a[k]<<" ";
    cout<<a[n-1];
	return 0
		;
}
int main()
{
	int n;
	scanf("%d",&n);
	int a[100];
	for(int i=0;i<n;i++)
	{
		int x;
		scanf("%d",&x);
		a[i]=x;
	}
	int *pi=a;
	int *pj=a+n;
	int t;
	for(;pi<pj;pi++,pj--)
	{
		t=*pi;
		*pi=*pj;
		*pj=t;
	}
	for(int k=1;k<n;k++)
	{
		printf("%d ",a[k]);
	}
         printf("%d",a[n]);
	return 0;
}
int main()
{
	int i,n,a[100],m;
	scanf("%d",&n);
	m=n;
	while(n!=0)
	{
		scanf("%d",&a[0]);
		for(i=1;i<n;i++)
		{
			a[i]=a[i-1];
		}
		n--;
	}
	for(i=0;i<m-1;i++)
	{
		printf("%d ",a[i]);
	}
	printf("%d",a[m-1]);
	return 0;
}
int main()
{
	int n;
	cin >> n;				//n?????
	int first [100] = {0};
	for (int i = 0;i <= n-1;i++)
	{
		cin >> first[i];
	}
	for (int i = 0;i <= n-1;i++)
	{
		if (i != n-1)
			cout << first[n-1-i] <<" ";
		else
			cout << first[n-1-i];
	}
	cin.get();
	cin.get();
	return 0;
}
int main()
{
	int n,i,a[100],b[100];
	cin>>n;
	for(i=0;i<=n-1;i++)
	cin>>a[i];
	for(i=0;i<=n-1;i++)
	b[i]=a[n-1-i];
	for(i=0;i<=n-2;i++)
	{cout<<b[i]<<" ";}
	cout<<b[n-1];
	return 0;
}
int A[100],n,i=0;                 //??????:??A????,????n,????i
void change()                     //?????????,?????
{
     cin>>A[i];
     i++;
     if (i<n)
        change();
     i--;
     if (i!=0)
        cout<<A[i]<<" ";
     else
        cout<<A[i];
}
int main()
{
    cin>>n;                      //??????
    change();                    //????change
    return 0;
}
int main(int argc, char* argv[])
{
	int n,a[100],t,i;
	scanf("%d",&n);
  	for(i=0;i<=n-1;i++)
		scanf("%d",&a[i]);
	for(i=0;i<=(n-1)/2;i++)
	{t=a[i];a[i]=a[n-i-1];a[n-i-1]=t;}
    for(i=0;i<=n-1;i++) 
	{if(i!=n-1) printf("%d ",a[i]);
	else printf("%d",a[i]);
	}
	return 0;
}
int main()
{
int n,i,k,m;
int sz[100];
scanf("%d",&n);
m=n/2;
for(i=0;i<n;i++)
scanf("%d",&sz[i]);
for(i=0;i<m;i++){
k=sz[i];
sz[i]=sz[n-i-1];
sz[n-i-1]=k;}
for(i=0;i<n;i++) 
    if (i<n-1)
    printf("%d ",sz[i]);
   else  printf("%d",sz[i]);

return 0;
}
int main()
{
	int cun[100]={0},fang[100]={0};
	int n;
	scanf("%d",&n);
	int i;
	for(i=0;i<n;i++)
	{
		scanf("%d",&cun[i]);
		fang[i]=cun[i];
	}
	for(i=0;i<n-1;i++)
	{
		cun[i]=fang[n-1-i];
		printf("%d ",cun[i]);
	}
	cun[n-1]=fang[0];
	printf("%d",cun[n-1]);
	return 0;
}
int main (void)
{
	int n, a[100], i, j;
	cin >> n;
	for (i = 0; i < n; i++)
		cin>> a[i];

	cout << a[n-1];
	for (i = n-2; i >= 0; i--)
		cout <<' '<<a[i];

	cout << endl;

	return 0;
}
int main() {
	int N;
	cin >>N;
	const int n=N;
	int a[n];
	for (int i=0;i<=n-1;i++)
	{
		cin >>a[i];
	}
	int b[n];
	for (int i=0;i<=n-1;i++)
	{
		b[i]=a[n-i-1];
	}
	for (int i=0;i<=n-1;i++)
	{
		cout <<b[i];
		if (i<n-1)
			cout <<" ";
	}
	return 0;
}
int main (){

  int n,m,e,i;
  int sz[100];
  scanf("%d",&n);

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

  if(n%2==0){
	  m=n/2;
  }else{
	  m=(n-1)/2;
  }
  for(i=0;i<m;i++){
	  e=sz[i];
	  sz[i]=sz[n-1-i];
	  sz[n-1-i]=e;
  }
  if(n%2!=0){
     sz[m]=sz[m];
  }

  for(i=0;i<n-1;i++){
     printf("%d ",(sz[i]));
  }
  printf("%d",sz[n-1]);


return 0;
}
void reverse(int n)
{
    if(n>0)
    {
        int c;
        char d;
        cin>>c;
        d=getchar();
        reverse(n-1);
        cout<<d<<c;}
}
int main()
{
    int n;
    cin>>n;
    reverse(n);
    return 0;
}
int main(){
	int n;
	int number[NUMBER];
	scanf("%d", &n);
	int i=0;
	int a;
	while(i<n){
		scanf("%d", &a);
		number[i]=a;
		i++;
	}
	while((n-1)>=0){
		if((n-1)>0){
			printf("%d ", number[n-1]);
		n--;
		}
		else{
			printf("%d", number[0]);
			n--;
		}
	}
	return 0;
	scanf("%d",1);
}
int main()
{
	int n,a[101]={0},b[101]={0},i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	for(i=0;i<n;i++)
	{	
		b[i]=a[n-i-1];
	}
	for(i=0;i<(n-1);i++)
		printf("%d ",b[i]);
	printf("%d",b[n-1]);
	
	
	return 0;
}
int main()
{
	int n,a[1000];
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	int t;
	for(int i=0;i<=(int)(0.5*(n+1))-1;i++)
	{
		t=a[i];
		a[i]=a[n-1-i];
		a[n-1-i]=t;

	}
	for(int i=0;i<n;i++)
	{
		cout<<a[i];
		if(i!=n-1) cout<<" ";
	
	}
	cout<<endl;
	return 0;
}
int main()
{
	int n;
	int a[100]={0};
	int *p,*q,r;
	cin>>n;
	for(p=a;p<a+n;p++)
	{
		cin>>*p;
	}
	for(p=a,q=a+n-1;p<q;p++,q--)
	{r=*p;*p=*q;*q=r;}
	for(p=a;p<a+n-1;p++)
	{cout<<*p<<" ";}
	cout<<*p;
	return 0;
}
int main ()
{
	int n,i,k;
	int sz[N];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&sz[i]);
	}
	for(i=0;i<n;i++){
		if(i<n-1){
		printf("%d ",sz[n-i-1]);
     	} else if(i=n-1){
		printf("%d",sz[n-i-1]);
	   }
    }
    return 0;
}
int main () {
	int a[100],n,i,b[50];
	scanf("%d",&n);
	for(i=0;i<=n-1;i++) {
		scanf("%d", &a[i]);}
	for(i=0;i<=(n-1)/2;i++){
        b[i]=a[n-i-1];
	    a[n-i-1]=a[i];
		a[i]=b[i];}
    for(i=0;i<=n-1;i++){
		if (i<=n-2){
		printf("%d ",a[i]);}
		else{printf("%d",a[i]);}}
		return 0;
	}
/*
 * 12.24.2.cpp
 *
 *  Created on: 2012-12-11
 *      Author: slkingxr
 */
int main()
{
	int a[101],i;
	int n,*p=NULL,*q=NULL,t;
	cin>>n;
	for(i=0;i<n;i++)
		cin >>a[i];
	for(p=a,q=a+n-1;p<q;p++,q--)
	{
		t=*p;
		*p=*q;
		*q=t;
	}
	for(p=a;p<a+n-1;p++)
		cout <<*p<<" ";
	cout <<*p;
	return 0;
}
int main()
{
	int n,i,j,temp;
	cin>>n;
	int a[101];
	for (i = 0;i < n;i++)
		cin>>a[i];
	int *p = a;
	for (i = 0,j = n-1;i < j;i++,j-- )
	{
		temp = *( p + i );
		*( p + i ) = *( p + j );
		*( p + j ) = temp;
	}
	for (i = 0;i < n;i++)
	{
		if (i == n-1)
			cout<<p[i];
		else
			cout<<p[i]<<' ';
	}
}