stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<cstdio>

#include<iostream>

using namespace std;

int main()

{

	int n;

	scanf("%d", &n);

	int *a = new int[n];

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

	{

		scanf("%d", a + i);

	}

	int nn = n / 2;

	if (n % 2 == 0)

	{

		for (int i = 0; i<nn; i++)

		{

			printf("%d ", a[n - 2 * i - 1]);

		}

		for (int i = 0; i<nn; i++)

		{

			printf("%d ", a[2 * i]);

		}

	}

	else

	{

		for (int i = 0; i<nn; i++)

		{

			printf("%d ", a[n - 2 * i - 1]);

		}

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

		for (int i = 0; i<nn; i++)

		{

			printf("%d ", a[2 * i + 1]);

		}

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.599440675453947x):
#include <stdio.h>

#include <string.h>

#define MAXN 100005



int main()

{

    int n;

    while(scanf("%d", &n) != EOF)

    {

        int a,num = n,flag = 1;

        int head[MAXN],tail[MAXN];

        int num_i = 0, num_j = 0;

        while(num--)

        {

            scanf("%d", &a);

            if(flag)

                tail[num_j++] = a;

            else

                head[num_i++] = a;

            flag = !flag;

        }

        if(n%2 == 0)

        {

            for(int i = num_i - 1; i >= 0; i--)

            {

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

            }

            for(int j = 0; j < num_j - 1; j++)

            {

                printf("%d ", tail[j]);

            }

            if(num_j)printf("%d\n", tail[num_j - 1]);

            else printf("\n");

        }

        else

        {

            for(int j = num_j - 1; j >= 0; j--)

            {

                printf("%d ", tail[j]);

            }

            for(int i = 0; i < num_i - 1; i++)

            {

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

            }

            if(num_i)printf("%d\n", head[num_i - 1]);

            else printf("\n");

        }

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

const int MAXN=2e5+5;

int a[MAXN];





int main()

{

    int n;

    while(cin>>n)

    {

        for(int i=1;i<=n;++i)   

        {

            cin>>a[i];

        }

        if(n&1)

        {

            cout<<a[n];

            for(int i=n-2;i>=1;i-=2)

                cout<<" "<<a[i];

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

                cout<<" "<<a[i];

            cout<<endl;

        }else

        {

            cout<<a[n];

            for(int i=n-2;i>=2;i-=2)

                cout<<" "<<a[i];

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

                cout<<" "<<a[i];

            cout<<endl;

        }

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.695467156909907x):
#include <stdio.h>

#include <string.h>

#define MAXN 100005



int main()

{

    int n;

    while(scanf("%d", &n) != EOF)

    {

        int a,num = n,flag = 1;

        int head[MAXN],tail[MAXN];

        int num_i = 0, num_j = 0;

        while(num--)

        {

            scanf("%d", &a);

            if(flag)

                tail[num_j++] = a;

            else

                head[num_i++] = a;

            flag = !flag;

        }

        if(n%2 == 0)

        {

            for(int i = num_i - 1; i >= 0; i--)

            {

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

            }

            for(int j = 0; j < num_j - 1; j++)

            {

                printf("%d ", tail[j]);

            }

            if(num_j)printf("%d\n", tail[num_j - 1]);

            else printf("\n");

        }

        else

        {

            for(int j = num_j - 1; j >= 0; j--)

            {

                printf("%d ", tail[j]);

            }

            for(int i = 0; i < num_i - 1; i++)

            {

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

            }

            if(num_i)printf("%d\n", head[num_i - 1]);

            else printf("\n");

        }

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int n;

int a[200000+5];

int main(){

	scanf("%d",&n);

	for(int i = 1; i <=n;i++){

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

	}

	for(int i = n;i >=1;i = i-2){

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

	}

	int i = 1;

	if(n%2==1)

		i =2;

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

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

	}

	//for(int i = 0;i<n;i++)

		

	printf("\n");

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 4.597965005161596x):
#include <stdio.h>

#include <string.h>

#define MAXN 100005



int main()

{

    int n;

    while(scanf("%d", &n) != EOF)

    {

        int a,num = n,flag = 1;

        int head[MAXN],tail[MAXN];

        int num_i = 0, num_j = 0;

        while(num--)

        {

            scanf("%d", &a);

            if(flag)

                tail[num_j++] = a;

            else

                head[num_i++] = a;

            flag = !flag;

        }

        if(n%2 == 0)

        {

            for(int i = num_i - 1; i >= 0; i--)

            {

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

            }

            for(int j = 0; j < num_j - 1; j++)

            {

                printf("%d ", tail[j]);

            }

            if(num_j)printf("%d\n", tail[num_j - 1]);

            else printf("\n");

        }

        else

        {

            for(int j = num_j - 1; j >= 0; j--)

            {

                printf("%d ", tail[j]);

            }

            for(int i = 0; i < num_i - 1; i++)

            {

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

            }

            if(num_i)printf("%d\n", head[num_i - 1]);

            else printf("\n");

        }

    }

    return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main()

{

	int n,m,y,z=0;

	cin >> n;

	y = n-1;

	int a[200010], b[200010];

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

	{

		cin >> a[i];

	}

	if ((n-1) % 2 == 0)

	{

		for (int j = n-1; j >=0; j--)

		{

			if (j % 2 == 0)

			{

				b[z] = a[j];

				z++;

			}

			else {

				b[y] = a[j];

				y--;

			}		

		}

	}

	else

	{

		for (int j = n-1; j >= 0; j--)

		{

			if (j % 2 != 0)

			{

				b[z] = a[j];

				z++;

			}

			else {

				b[y] = a[j];

				y--;

			}		

		}

	}

	

	for (int x = 0; x < n-1; x++)

	{

		cout << b[x] << " ";

	}

	cout << b[n - 1] << endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.835074667616643x):
#include <stdio.h>

#include <string.h>

#define MAXN 100005



int main()

{

    int n;

    while(scanf("%d", &n) != EOF)

    {

        int a,num = n,flag = 1;

        int head[MAXN],tail[MAXN];

        int num_i = 0, num_j = 0;

        while(num--)

        {

            scanf("%d", &a);

            if(flag)

                tail[num_j++] = a;

            else

                head[num_i++] = a;

            flag = !flag;

        }

        if(n%2 == 0)

        {

            for(int i = num_i - 1; i >= 0; i--)

            {

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

            }

            for(int j = 0; j < num_j - 1; j++)

            {

                printf("%d ", tail[j]);

            }

            if(num_j)printf("%d\n", tail[num_j - 1]);

            else printf("\n");

        }

        else

        {

            for(int j = num_j - 1; j >= 0; j--)

            {

                printf("%d ", tail[j]);

            }

            for(int i = 0; i < num_i - 1; i++)

            {

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

            }

            if(num_i)printf("%d\n", head[num_i - 1]);

            else printf("\n");

        }

    }

    return 0;

}
// Slower C++ solution:
#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<iostream>

#include<algorithm>

using namespace std;

#define ll long long

int a[210000],b[210000];

int main()

{

    int n;

    while(scanf("%d",&n)!=EOF)

    {

        int i,j,q=1,flag=1,k=0;

        memset(a,0,sizeof(a));

        memset(b,0,sizeof(b));

        for(i=1; i<=n; i++)

        {

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

        }

        if(n%2==0)

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n; i>n/2; i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        else

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

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

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        for(i=1; i<=n; i++)

        {

            if(i==1)

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

            else

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

        }



        printf("\n");

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.6488497940243803x):
#include<iostream>

#include<deque>

#include<string>



using namespace std;

int main()

{

	int n, t;

	bool back = true;

	deque<int> res;

	cin >> n;

	while (n--)

	{

		cin >> t;

		if (back)

			res.push_back(t);

		else

			res.push_front(t);

		back = !back;

	}

	back = !back;

	if (back)

	{

		cout << *(res.end()-1);

		res.pop_back();

		while (!res.empty())

		{

			cout <<' '<< *(res.end()-1);

			res.pop_back();

		}

	}

	else

	{

		cout << *res.begin() ;

		res.pop_front();

		while (!res.empty())

		{

			cout <<' '<< *res.begin();

			res.pop_front();

		}

	}

	return 0;

}
// Slower C++ solution:
#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<iostream>

#include<algorithm>

using namespace std;

#define ll long long

int a[210000],b[210000];

int main()

{

    int n;

    while(scanf("%d",&n)!=EOF)

    {

        int i,j,q=1,flag=1,k=0;

        memset(a,0,sizeof(a));

        memset(b,0,sizeof(b));

        for(i=1; i<=n; i++)

        {

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

        }

        if(n%2==0)

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n; i>n/2; i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        else

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

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

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        for(i=1; i<=n; i++)

        {

            if(i==1)

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

            else

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

        }



        printf("\n");

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.6772355795679506x):
#include<iostream>

#include<queue>

#include<stack>

using namespace std;

deque<int> q;

int main()

{    int n;    

scanf("%d",&n);    

 for(int i=1;i<=n;i++) 

    {        int a;        

    scanf("%d",&a);       

     if(i%2==0)           

      q.push_front(a);       

       else           

        q.push_back(a);    }  

          if(n%2==0)    

          {       

               printf("%d",q.front());     

                  q.pop_front();  

                        while(!q.empty())  

                              {     

                                         printf(" %d",q.front());   

                                                  q.pop_front();        }  

  

                                                       

                                                        printf("\n");    }    else    {        printf("%d",q.back());        q.pop_back();        while(!q.empty())        {            printf(" %d",q.back());            q.pop_back();        }        printf("\n");    }     return 0;}
// Slower C++ solution:
#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<iostream>

#include<algorithm>

using namespace std;

#define ll long long

int a[210000],b[210000];

int main()

{

    int n;

    while(scanf("%d",&n)!=EOF)

    {

        int i,j,q=1,flag=1,k=0;

        memset(a,0,sizeof(a));

        memset(b,0,sizeof(b));

        for(i=1; i<=n; i++)

        {

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

        }

        if(n%2==0)

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n; i>n/2; i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        else

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

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

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        for(i=1; i<=n; i++)

        {

            if(i==1)

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

            else

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

        }



        printf("\n");

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.6774889465860623x):
#include<iostream>

#include<queue>

#include<cstdio>

using namespace std;







int main()

{

    deque<int> ans;

    int n;

    scanf("%d",&n);

    for(int i = 1; i<=n; i++)

    {

        int num;

        scanf("%d",&num);

        if(i&1)

            ans.push_front(num);

        else

            ans.push_back(num);

    }

    int i = 0;

    if(n&1)

    {

        while(i<n-1)

        {

            printf("%d ",ans.front());

            ans.pop_front();

            i++;

        }

        printf("%d\n",ans.front());

    }

    else

    {

        while(i<n-1)

        {

            printf("%d ",ans.back());

            ans.pop_back();

            i++;

        }

        printf("%d\n",ans.back());

    }

    return 0;

}
// Slower C++ solution:
#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<iostream>

#include<algorithm>

using namespace std;

#define ll long long

int a[210000],b[210000];

int main()

{

    int n;

    while(scanf("%d",&n)!=EOF)

    {

        int i,j,q=1,flag=1,k=0;

        memset(a,0,sizeof(a));

        memset(b,0,sizeof(b));

        for(i=1; i<=n; i++)

        {

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

        }

        if(n%2==0)

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

            for(i=n; i>n/2; i--)

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        else

        {

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

            {

                b[i]=a[n-k];

                k+=2;

            }

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

            {

                b[i]=a[n-q];

                q+=2;

            }

        }

        for(i=1; i<=n; i++)

        {

            if(i==1)

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

            else

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

        }



        printf("\n");

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.597810850341097x):
#include<iostream>

#include<cstdio>

#include<cmath>

#include<cstring>

#include<string>

#include<algorithm>



using namespace std;



int main() {

    ios :: sync_with_stdio(false);

    int a[200005], n, i;

    cin>>n;

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

        cin>>a[i];

    }



    for(i=n-1; i>=0; i-=2) {

        cout<<a[i]<<' ';

    }

    if(n%2) {

        for(i=1; i<n; i+=2) {

            cout<<a[i]<<' ';

        }

    }

    else {

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

            cout<<a[i]<<' ';

        }

    }

    cout<<endl;

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<iomanip>

#include<cmath>

#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

#include<set>

#include<map>

#include<queue>

#include<stack>

#include<vector>

#include<cctype>

#define szxb 200010

#define F(a,b,c,d,e) for(register int (a)(b);((e)?((a)<=(c)):((a)>=(c)));(a)+=(d))

using namespace std;

int n,a[szxb];

inline void print(int x){putchar(32),printf("%d",x);return;}

signed main()

{

	scanf("%d",&n);

	F(i,1,n,1,1){scanf("%d",&a[i]);}printf("%d",a[n]);

	F(i,(n-2),1,-2,0){print(a[i]);}F(i,(1+(n&1)),n,2,1){print(a[i]);}

	return putchar(10),0;

}

// Faster C++ solution for the same problem (measured speedup: 5.258576072957225x):
#include<cstdio>

int n,a[200010];

inline int read(){

	int ret=0;char c=getchar();

	while(c<'0'||c>'9')c=getchar();

	while(c>='0'&&c<='9')ret=(ret<<1)+(ret<<3)+(c^48),c=getchar();

	return ret;

}

int main()

{

	n=read();

	for(register int i=1;i<=n;++i)a[i]=read();

	for(register int i=n;i>0;i-=2)printf("%d ",a[i]);

	for(register int i=(n&1)+1;i<=n;i+=2)printf("%d ",a[i]);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define ll long long

int a[200100];

int b[100100],c[100100];

int main()

{

    std::ios::sync_with_stdio(false);

    std::cin.tie(0);

    int i,j,k,m,n;

    int bb=0,cc=0;

    cin>>n;

    for(i=1; i<=n; i++)

        cin>>a[i];

    if(n%2==0)

    {

        for(i=2; i<=n; i++)

        {

            if(i%2==0)

            {

                b[++bb]=a[i];

            }

            else

                c[++cc]=a[i];

        }

    }

    else

    {

        for(i=2; i<=n; i++)

        {

            if(i%2!=0)

            {

                b[++bb]=a[i];

            }

            else

                c[++cc]=a[i];

        }

    }

    for(i=bb; i>=1; i--)

        cout<<b[i]<<' ';

    cout<<a[1]<<' ';

    for(i=1; i<cc; i++)

        cout<<c[i]<<' ';

    if(cc)

        cout<<c[cc]<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.397119843425135x):
#include<cstdio>

int n,a[200010];

inline int read(){

	int ret=0;char c=getchar();

	while(c<'0'||c>'9')c=getchar();

	while(c>='0'&&c<='9')ret=(ret<<1)+(ret<<3)+(c^48),c=getchar();

	return ret;

}

int main()

{

	n=read();

	for(register int i=1;i<=n;++i)a[i]=read();

	for(register int i=n;i>0;i-=2)printf("%d ",a[i]);

	for(register int i=(n&1)+1;i<=n;i+=2)printf("%d ",a[i]);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int n;

vector <int> V;



int main() {

    scanf("%d", &n);

    for (int i = 1; i <= n; ++i) {

    	int temp;

        scanf("%d", &temp);

        if((n + i) & 1) V.push_back(temp);

        else V.insert(V.begin(), temp);

    }

    for (int i = 0; i < n; ++i) printf("%d ", V[i]);

}

// Faster C++ solution for the same problem (measured speedup: 5.270329598419974x):
#include<cstdio>

int n,a[200010];

inline int read(){

	int ret=0;char c=getchar();

	while(c<'0'||c>'9')c=getchar();

	while(c>='0'&&c<='9')ret=(ret<<1)+(ret<<3)+(c^48),c=getchar();

	return ret;

}

int main()

{

	n=read();

	for(register int i=1;i<=n;++i)a[i]=read();

	for(register int i=n;i>0;i-=2)printf("%d ",a[i]);

	for(register int i=(n&1)+1;i<=n;i+=2)printf("%d ",a[i]);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

deque<int> dq;

int n,w;

int main()

{

    cin>>n;

    for(int i=n%2;i<n+n%2;i++)

    {

        cin>>w;

        if(i%2==0) dq.push_back(w);

        else dq.push_front(w);

    }

    for(deque<int>::iterator i=dq.begin();i!=dq.end();i++)

    cout<<*i<<" ";

}

// Faster C++ solution for the same problem (measured speedup: 5.369058914862417x):
#include<cstdio>

int n,a[200010];

inline int read(){

	int ret=0;char c=getchar();

	while(c<'0'||c>'9')c=getchar();

	while(c>='0'&&c<='9')ret=(ret<<1)+(ret<<3)+(c^48),c=getchar();

	return ret;

}

int main()

{

	n=read();

	for(register int i=1;i<=n;++i)a[i]=read();

	for(register int i=n;i>0;i-=2)printf("%d ",a[i]);

	for(register int i=(n&1)+1;i<=n;i+=2)printf("%d ",a[i]);

	return 0;

}
// Slower C++ solution:
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")

//#pragma GCC optimize(2)

//#include <immintrin.h>

#include<bits/stdc++.h>

using namespace std;

int main()

{

   	deque<int> a;

   	int n,o;

   	cin >> n;

   	for(int i = 1;i <= n;i ++)

   	{

   		cin >> o;

   		if(i & 1)

   			a.push_back(o);

   		else

   			a.push_front(o);

	}

	if(n & 1)

		reverse(a.begin(), a.end());	

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

	{

		cout << a[i] << " ";

	}

	puts("");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.372836461955342x):
#include<cstdio>

int n,a[200010];

inline int read(){

	int ret=0;char c=getchar();

	while(c<'0'||c>'9')c=getchar();

	while(c>='0'&&c<='9')ret=(ret<<1)+(ret<<3)+(c^48),c=getchar();

	return ret;

}

int main()

{

	n=read();

	for(register int i=1;i<=n;++i)a[i]=read();

	for(register int i=n;i>0;i-=2)printf("%d ",a[i]);

	for(register int i=(n&1)+1;i<=n;i+=2)printf("%d ",a[i]);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define ll long long

int a[200100];

int b[100100],c[100100];

int main()

{

    std::ios::sync_with_stdio(false);

    std::cin.tie(0);

    int i,j,k,m,n;

    int bb=0,cc=0;

    cin>>n;

    for(i=1; i<=n; i++)

        cin>>a[i];

    if(n%2==0)

    {

        for(i=2; i<=n; i++)

        {

            if(i%2==0)

            {

                b[++bb]=a[i];

            }

            else

                c[++cc]=a[i];

        }

    }

    else

    {

        for(i=2; i<=n; i++)

        {

            if(i%2!=0)

            {

                b[++bb]=a[i];

            }

            else

                c[++cc]=a[i];

        }

    }

    for(i=bb; i>=1; i--)

        cout<<b[i]<<' ';

    cout<<a[1]<<' ';

    for(i=1; i<cc; i++)

        cout<<c[i]<<' ';

    if(cc)

        cout<<c[cc]<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.097728310813059x):
// luogu-judger-enable-o2

#include<cstdio>

#include<vector>

using namespace std;

int n,x;

vector<int>a;

inline int read(){

	int ret=0;char c=getchar();

	while(c<'0'||c>'9')c=getchar();

	while(c>='0'&&c<='9')ret=(ret<<1)+(ret<<3)+(c^48),c=getchar();

	return ret;

}

int main()

{

	n=read();

	for(register int i=1;i<=n;++i)x=read(),a.push_back(x);

	for(register int i=n;i>0;i-=2)printf("%d ",a[i-1]);

	for(register int i=(n&1)+1;i<=n;i+=2)printf("%d ",a[i-1]);

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<iomanip>

#include<cmath>

#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

#include<set>

#include<map>

#include<queue>

#include<stack>

#include<vector>

#include<cctype>

#define szxb 200010

#define F(a,b,c,d,e) for(register int (a)(b);((e)?((a)<=(c)):((a)>=(c)));(a)+=(d))

using namespace std;

int n,a[szxb];

inline void print(int x){putchar(32),printf("%d",x);return;}

signed main()

{

	scanf("%d",&n);

	F(i,1,n,1,1){scanf("%d",&a[i]);}printf("%d",a[n]);

	F(i,(n-2),1,-2,0){print(a[i]);}F(i,(1+(n&1)),n,2,1){print(a[i]);}

	return putchar(10),0;

}

// Faster C++ solution for the same problem (measured speedup: 5.258576072957225x):
#include<cstdio>

int n,a[200010];

inline int read(){ 

    register int ret=0;char c=getchar();

    while(c<'0'||c>'9')c=getchar();

    while(c>='0'&&c<='9')ret=(ret<<1)+(ret<<3)+(c^48),c=getchar();

    return ret;

}

int main()

{

    n=read();

    for(register int i=1;i<=n;++i)a[i]=read();

    for(register int i=n;i>0;i-=2)printf("%d ",a[i]);//first 

    for(register int i=(n&1)+1;i<=n;i+=2)printf("%d ",a[i]);//second 

    return 0;

}