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

#include<list>

using namespace std;

int A[200005];

list<int>::iterator it;

list<int>::reverse_iterator iq;

int main()

{

int n;

cin >> n;

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

{

	cin >> A[i];

}

list<int> c(1,A[0]);



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

{

 if(i%2==0) c.push_back(A[i-1]);

 else c.push_front(A[i-1]);	

}



if(n%2!=0) {

	for(it=c.begin();it!=c.end();it++)

	{

		cout << *it<<" ";

	}

}

else {

for(iq=c.rbegin();iq!=c.rend();iq++)

{

	cout << *iq<<" ";

}

}

return 0;	

}

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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

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

#include<list>

using namespace std;

int A[200005];

list<int>::iterator it;

list<int>::reverse_iterator iq;



int main(){

	int n;

	cin >> n;

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

    	cin >> A[i];

	}

	list<int> c(1,A[0]);

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

		if(i%2==0) c.push_back(A[i-1]);

		else c.push_front(A[i-1]);	

	} 

	if(n%2!=0) {

	   for(it=c.begin();it!=c.end();it++){

			cout << *it<<" ";

		}

	}

	else {

		for(iq=c.rbegin();iq!=c.rend();iq++){

		cout << *iq<<" ";

		}

	}

	return 0;	

}

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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

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

using namespace std;

typedef long long ll;

const int MAXSIZE=10000020;

int bufpos;

char buf[MAXSIZE];

#define NEG 0

void init(){

	#ifdef LOCAL

		freopen("F.txt","r",stdin);

	#endif

	buf[fread(buf,1,MAXSIZE,stdin)]='\0';

	bufpos=0;

}

#if NEG

int readint(){

	bool isneg;

	int val=0;

	for(;!isdigit(buf[bufpos]) && buf[bufpos]!='-';bufpos++);

	bufpos+=(isneg=buf[bufpos]=='-');

	for(;isdigit(buf[bufpos]);bufpos++)

		val=val*10+buf[bufpos]-'0';

	return isneg?-val:val;

}

#else

int readint(){

	int val=0;

	for(;!isdigit(buf[bufpos]);bufpos++);

	for(;isdigit(buf[bufpos]);bufpos++)

		val=val*10+buf[bufpos]-'0';

	return val;

}

#endif

char readchar(){

	for(;isspace(buf[bufpos]);bufpos++);

	return buf[bufpos++];

}

int readstr(char* s){

	int cur=0;

	for(;isspace(buf[bufpos]);bufpos++);

	for(;!isspace(buf[bufpos]);bufpos++)

		s[cur++]=buf[bufpos];

	s[cur]='\0';

	return cur;

}

int b[200002];

int main(){

	init();

	int n=readint();

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

		b[i]=readint();

	if (n%2){

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

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

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

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

	}else{

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

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

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

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

	}

}

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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

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

#include<iostream>

#include<string.h>

#include<algorithm>

#include<map>

#include<vector>

#include<string>

#define ll long long

#define For(i,x,y)  for(ll i=x;i<=y;++i)

#define FOr(i,x,y)  for(ll i=x;i>=y;--i)

using namespace std;

inline ll read(){   ll x=0,f=1;char ch=getchar();   while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}  while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}  return x*f; } 

inline void write(ll x){    if (x<0) putchar('-'),x=-x; if (x>=10) write(x/10);   putchar(x%10+'0');  } 

inline void writeln(ll x){ write(x);   puts("");   }

const ll N=400010;

ll n,a[N],b[N];

int main(){

	n=read();

	For(i,1,n)	a[i]=read();

	ll l=1,r=n,rev=1;

	FOr(i,n,1){

		if (rev)	b[l++]=a[i];

		else	b[r--]=a[i];

		rev^=1;

	}

	For(i,1,n)	printf("%lld ",b[i]);

}

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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

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

using namespace std;



int main() {



	int length;

	cin >> length;

	int *a = new int[length];

	int *b = new int[length];

	for (int i = 0; i < length; i++) {

		cin >> a[i];

	}



	int left = 0, right = length - 1;

	if (length % 2 == 0) {

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

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

			b[right--] = a[i - 1];

		}

	}

	else {

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

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

			b[right--] = a[i - 1];

		}

		b[length / 2] = a[0];

	}





	for (int i = 0; i < length; i++) {

		cout << b[i] << " ";

	}

}






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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

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

using namespace std;



int main() {

	int a[200001];

	int n;

	cin >> n;

	if (n){

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

	        cin >>a[i];

	   }

	    if (n==1){

	        cout<<a[1];

	        return 0;

	    }

	    if (n%2){

	       

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

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

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

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

                cout<<a[n-1];

                cout<<endl;

	    }

	    else{

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

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

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

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

               cout<<a[n-1];

           cout<<endl;

	    }

	}

	return 0;

}

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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

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

using namespace std;

int a[200050];

int main() {

	

	int n,i;

	cin >> n;

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

		cin >> a[i];

	}

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

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

	}

	i++;

	if (n % 2) i += 2;

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

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

	}

	return 0;

}

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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

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

#include<stdio.h>

using namespace std;

int a[200050], b[200050];

int main()

{

	int n;

	scanf("%d", &n);

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

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

	b[n / 2 + 1] = a[1];

	if (n % 2)

	{

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

		{

			b[n / 2 + 1 + i] = a[2 * i];

			b[n / 2 + 1 - i] = a[2 * i + 1];

		}

	}

	else

	{

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

		{

			b[n / 2 + 1 - i] = a[2 * i];

		}

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

		{

			b[n / 2 + 1 + i] = a[2 * i + 1];

		}

	}

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

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

	printf("%d\n", b[n]);

	return 0;

}

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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

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

int a[500000];

int main(){

int q,h,i,j,k,l,m,n,r;

l=250000;

r=250001;

k=0;

scanf("%d",&n);

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

 if(k==0){

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

 	r++;

 	k=1;

 }

 else{

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

 	l--;

 	k=0;

 }

 

}

if(k==0){

for(i=l+1;i<r;i++){

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

}

}

else{

	for(i=r-1;i>l;i--){

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

}

}

return 0;

} 

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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

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

#include<stack>

#include<queue>

using namespace std;

int main()

{

    int n,i;

    int a;

    while(cin>>n)

    {

        

        

        queue<int> b;

        stack<int> c;

        if(n%2==0)

        {

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

            {

                cin>>a;

             if(i%2==0)

             c.push(a);

             else 

             b.push(a);

            }

             

            while(!c.empty())

        {

            int k=c.top();

            cout<<k<<" ";

            c.pop();



        }

         while(b.size()>1)

        {

            int k=b.front();

            cout<<k<<" ";

            b.pop();



        }

        cout<<b.front()<<endl;





        }

        else if(n>1)

        {

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

            {

                cin>>a;

             if(i%2==0)

             b.push(a);

             else 

             c.push(a);

            }

             

             while(!c.empty())

            

            {

                int k=c.top();

                cout<<k<<" ";

                c.pop();

            }

            while(b.size()>1)

        {

            int k=b.front();

            cout<<k<<" ";

            b.pop();



        }

        cout<<b.front()<<endl;



        }

        if(n==1)

        {

            cin>>a;

            cout<<a<<endl;

        }

        

        

         } 

        

    

    return 0;

}

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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

}
// Slower C++ solution:
//author:happylkx

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>

#include <string.h>

#include <string>

#include <math.h>

#include <queue>

#include <stack>

#include <list>

using namespace std;

typedef long long LL;



int main()

{

	int n;

	cin >> n;

	list <int> li;

	bool rev = false;

	while (n--) {

		int temp;

		cin >> temp;

		if (rev)li.push_front(temp);

		else li.push_back(temp);

		rev = !rev;

	}

	if (rev) {

		li.reverse();

		for (auto i : li) {

			cout << i << " ";

		}

	}

	else {

		for (auto i : li) {

			cout << i << " ";

		}

	}



	return 0;

}


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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

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

#include "deque"

#include "vector"

using namespace std;

typedef long long ll;

int main()

{

    ll n,x;

    cin >> n;

    deque<ll> deq;

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

        cin >> x;

        if (i%2==0)

        deq.push_back(x);

        else deq.push_front(x);

    }

    bool flag=false;

    if (n%2==0){

        for(int i=0;i<deq.size();i++){

            if (flag) cout << " ";

            flag=true;

            cout << *(i+deq.begin());

        }

    }else {

        for (int i=deq.size()-1;i>=0;i--){

           if (flag) cout << " ";

            flag=true;

          cout << *(i+deq.begin());

    }

    }



    return 0;

}


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

#include<stdlib.h>

#pragma warning(disable:4996)

int main()

{

	int a;

	scanf("%d", &a);

	long long *b = (long long *)malloc(sizeof(long long)*a);

	long long *c = (long long *)malloc(sizeof(long long)*a);

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

	{

		scanf("%lld", b + i);

	}

	int A = a;

	if (a % 2 == 0)

	{

		for (int i = 0; i < A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 0; i < A/2; i++)

		{

			c[i+A/2] = b[2 * i];

		}

	}

	if (a % 2 == 1)

	{

		for (int i = 0; i <= A/2; i++)

		{

			c[i] = b[a - 2 * i-1];

		}

		for (int i = 1; i <= A / 2; i++)

		{

			c[A / 2+i] = b[2 * i-1];

		}

	}

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

	{

		printf("%lld ", c[i]);

	}

	getchar();

	getchar();

	return 0;

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

#include <algorithm>

#include <vector>

#include <string>

#include <stack>

#include <queue>

#include <cctype>

#include <cmath>

#include <map>

#include <set>

#define rep(i, m, n) for(int i = m;i < n;i++)

#define repr(i, n) for(int i = n;i >= 0;i--)

#define ll long long

#define ull unsigned long long

#define pb(a) push_back(a)

#define popb(a) pop_back(a)

#define debug(x) cout<<#x<<": "<<x<<endl

#define SORT(v, n) sort(v, v+n);

#define VSORT(v) sort(v.begin(), v.end());

#define INF 999999999

#define PI 3.14159265358979

using namespace std;

typedef pair<int, int> P;

typedef pair<ll, ll> LP;

typedef pair<int, P> PP;

typedef pair<ll, LP> LPP;

 

int dy[]={0, 0, 1, -1, 0};

int dx[]={1, -1, 0, 0, 0};

 

int main(){

  ll n,b[200005]={};

  cin>>n;

  rep(i,0,n){

    cin>>b[i];

  }

  if(n%2==0){

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

      if(i!=n-1&&i%2==1)cout<<" ";

      if(i%2==1)cout<<b[i];

    }

    cout<<" ";

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

      if(i%2==0)cout<<b[i];

      if(i!=n-1&&i%2==0)cout<<" ";

    }

    cout<<endl;

  }else{

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

      if(i!=n-1&&i%2==0)cout<<" ";

      if(i%2==0)cout<<b[i];

    }

    cout<<" ";

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

      if(i%2==1)cout<<b[i];

      if(i!=n-1&&i%2==1)cout<<" ";

    }

    cout<<endl;

  }

}

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

#include <algorithm>

#include <vector>

#include <string>

#include <stack>

#include <queue>

#include <cctype>

#include <cmath>

#include <map>

#include <set>

#define rep(i, m, n) for(int i = m;i < n;i++)

#define repr(i, m, n) for(int i = m;i >= n;i--)

#define ll long long

#define ull unsigned long long

#define push(a) push_back(a)

#define pop(a) pop_back(a)

#define debug(x) cout<<#x<<": "<<x<<endl

#define SORT(v, n) sort(v, v+n);

#define VSORT(v) sort(v.begin(), v.end());

#define INF 999999999

#define PI 3.14159265358979

using namespace std;

typedef pair<int, int> P;

typedef pair<ll, ll> LP;

typedef pair<int, P> PP;

typedef pair<ll, LP> LPP;



int dy[]={0, 0, 1, -1, 0};

int dx[]={1, -1, 0, 0, 0};



int main(){

    deque<int> dq;

    int n,a;

    cin>>n;

    rep(i,0,n){

        cin>>a;

        if(i%2==1){

            dq.push_back(a);

        }else{

            dq.push_front(a);

        }

    }

    if(n%2==0){

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

    }

    rep(i,0,n){

        if(i)cout<<" ";

        cout<<dq[i];

    }

    cout<<endl;

}
// Slower C++ solution:
#define ll long long

#define ffor(i, a, b) for (int i = (a); i < (b); i++)

#define rfor(i, a, b) for (int i = (b)-1; i >= (a); i--)

#define rep(i, n) for (int i = 0; i < (n); i++)

#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)

#include <algorithm>

#include <cmath>

#include <cstdio>

#include <deque>

#include <iomanip>

#include <iostream>

#include <map>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <vector>

#define SIZE 100001

#define MOD 1000000007

#define INF 100000000

using namespace std;



int main() {

  int n;

  scanf("%d", &n);



  vector<int> a(250001);

  deque<int> deq;

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



  rep(i, n) {

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

      deq.push_front(a[i]);

    else

      deq.push_back(a[i]);

  }



  for (auto x : deq) printf("%d ", x);

  printf("\n");

}

// Faster C++ solution for the same problem (measured speedup: 2.014155501470456x):
#define ll long long

#define ffor(i, a, b) for (int i = (a); i < (b); i++)

#define rfor(i, a, b) for (int i = (b)-1; i >= (a); i--)

#define rep(i, n) for (int i = 0; i < (n); i++)

#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)

#include <algorithm>

#include <cmath>

#include <cstdio>

#include <deque>

#include <iomanip>

#include <iostream>

#include <map>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <vector>

#define SIZE 100001

#define MOD 1000000007

#define INF 100000000

using namespace std;



int main() {

  int n;

  scanf("%d", &n);



  // vector<int> a(250001);

  deque<int> deq;

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



  rep(i, n) {

    int a;

    scanf("%d", &a);

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

      deq.push_front(a);

    else

      deq.push_back(a);

  }



  for (auto x : deq) printf("%d ", x);

  printf("\n");

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

using namespace std;

long long a,k;

vector<int>n;

int main()

{

    cin>>a;

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

    {

        cin>>k;

        if((i+a+1)%2)n.push_back(k);

        else n.insert(n.begin(),k);

    }

    for(int i=0; i<a; i++)cout<<n[i]<<" ";

}

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

#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;

}