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

#include <cstdlib>

#include <cstring>

#include <deque>

#include <iostream>

#include <vector>

using namespace std;



const int N = 2e5;

deque<int> q;



int n;



int main()

{

    scanf("%d", &n);

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

    {

        int x;

        scanf("%d", &x);

        if (i & 1)

            q.push_back(x);

        else

            q.push_front(x);

    }

    if ((n & 1) == 0)

    {

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

        {

            printf("%d ", *it);

        }

        return 0;

    }

    else

    {

        deque<int>::iterator it = q.end();

        --it;

        for (; it != q.begin(); --it)

        {

            printf("%d ", *it);

        }

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

        return 0;

    }

    return 0;

}

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

int main(){

	int n;

	int a[200009];

	scanf("%d",&n);

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

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

	}

	if(n==1) printf("%d\n",a[1]);

	else{

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

		if(n%2==0){

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

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

			}

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

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

			}

		}

		else{

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

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

			}

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

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

			}	

		}

		printf("\n");

	}

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

#include <cstdlib>

#include <cstring>

#include <deque>

#include <iostream>

#include <vector>

using namespace std;



const int N = 2e5;

deque<int> q;



int n;



int main()

{

    scanf("%d", &n);

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

    {

        int x;

        scanf("%d", &x);

        if (i & 1)

            q.push_back(x);

        else

            q.push_front(x);

    }

    if ((n & 1) == 0)

    {

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

        {

            printf("%d ", *it);

        }

        return 0;

    }

    else

    {

        deque<int>::iterator it = q.end();

        --it;

        for (; it != q.begin(); --it)

        {

            printf("%d ", *it);

        }

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

        return 0;

    }

    return 0;

}

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

long long int a[500050];

int main(){

	int n;

	while(~scanf("%d",&n)){

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

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

	}

	if(n%2==0){//为偶数 

		if(n==2){

			printf("%lld %lld\n",a[2],a[1]);

		}

		else{

		for(int i = n;i>=2;i--){//偶数从左往右从大到小输出 

			if(i%2==0){

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

			}

		}

		printf("%lld",a[1]);//输出a【1】 

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

			if(i%2==1){

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

			}

		}

		printf("\n");

		}

	}

	else if(n%2==1){

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

			if(i%2==1){

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

			}

		}

		printf("%lld",a[1]);

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

			if(i%2==0){

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

			}

		}

		printf("\n");

	}

}

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

#include <cstdlib>

#include <cstring>

#include <deque>

#include <iostream>

#include <vector>

using namespace std;



const int N = 2e5;

deque<int> q;



int n;



int main()

{

    scanf("%d", &n);

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

    {

        int x;

        scanf("%d", &x);

        if (i & 1)

            q.push_back(x);

        else

            q.push_front(x);

    }

    if ((n & 1) == 0)

    {

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

        {

            printf("%d ", *it);

        }

        return 0;

    }

    else

    {

        deque<int>::iterator it = q.end();

        --it;

        for (; it != q.begin(); --it)

        {

            printf("%d ", *it);

        }

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

        return 0;

    }

    return 0;

}

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

#include<cmath>

#include<cstring>

#include<algorithm>

using namespace std;

int a[1000560];

int main(){

	int n,j,i;

	while(~scanf("%d",&n)){

		int t;

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

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

		}

		if(n%2==0){

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

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

			}

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

				if(i==n-1){

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

				}

				else{

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

				}	 

			}

		}

		if(n%2==1){

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

				

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

				

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

				

				if(i==n-1){

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

				}

				else{

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

				}

			}

		}

		printf("\n");

	}

	return 0;

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

#include <cstdlib>

#include <cstring>

#include <deque>

#include <iostream>

#include <vector>

using namespace std;



const int N = 2e5;

deque<int> q;



int n;



int main()

{

    scanf("%d", &n);

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

    {

        int x;

        scanf("%d", &x);

        if (i & 1)

            q.push_back(x);

        else

            q.push_front(x);

    }

    if ((n & 1) == 0)

    {

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

        {

            printf("%d ", *it);

        }

        return 0;

    }

    else

    {

        deque<int>::iterator it = q.end();

        --it;

        for (; it != q.begin(); --it)

        {

            printf("%d ", *it);

        }

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

        return 0;

    }

    return 0;

}

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

#include<cstdio>

#include<cstdlib>

#include<map>

#include<cstring>

#include<algorithm>

#define ll long long

#define Max(x,y) ((x) > (y) ? (x) : (y))

#define Min(x,y) ((x) < (y) ? (x) : (y))

#define Abs(x) ((x) > 0 ? (x) : -(x))

#define mod 1000000007

#define N 300010

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;

}



int n;

int q[N],head1,head2;



int main(){

	int n = read();

	q[100010] = read();

	head1 = 100010;

	head2 = 100010;

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

		if(i&1) q[++head1] = read();

		else q[--head2] = read();

	}

	if(!(n&1)){

		for(;head1 >= head2;head1--)

			printf("%d ",q[head1]);

	}

	else{

		for(;head2 <= head1;head2++)

			printf("%d ",q[head2]);

	}

	puts("");

	return 0;

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

int main(){

	int n;

	int a[200009];

	scanf("%d",&n);

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

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

	}

	if(n==1) printf("%d\n",a[1]);

	else{

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

		if(n%2==0){

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

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

			}

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

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

			}

		}

		else{

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

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

			}

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

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

			}	

		}

		printf("\n");

	}

}

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

#include<cstdio>

#include<cstdlib>

#include<map>

#include<cstring>

#include<algorithm>

#define ll long long

#define Max(x,y) ((x) > (y) ? (x) : (y))

#define Min(x,y) ((x) < (y) ? (x) : (y))

#define Abs(x) ((x) > 0 ? (x) : -(x))

#define mod 1000000007

#define N 300010

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;

}



int n;

int q[N],head1,head2;



int main(){

	int n = read();

	q[100010] = read();

	head1 = 100010;

	head2 = 100010;

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

		if(i&1) q[++head1] = read();

		else q[--head2] = read();

	}

	if(!(n&1)){

		for(;head1 >= head2;head1--)

			printf("%d ",q[head1]);

	}

	else{

		for(;head2 <= head1;head2++)

			printf("%d ",q[head2]);

	}

	puts("");

	return 0;

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

#include <bitset>

#include <cassert>

#include <cctype>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define LL long long

#define pb push_back

#define pob pop_back

#define mp make_pair

#define FILL(a,v) memset((void*)a,v,sizeof(a))

#define FILL0(a) FILL(a,0)

#define FILL1(a) FILL(a,-1)

#define ALL(a) (a).begin(),(a).end()

#define Inf 1e9

#define Mod 1000000007

#define foreach(it,x) for(typeof(x.begin()) it=x.begin();it!=x.end();it++)

#define FOR(i,x) for(int i=0;i<x;i++)

#define RFOR(i,x) for(int i=x-1;i>=0;i--)

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

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

#define SZ(a) ((int)(a).size())

#define FI first

#define SE second

#define OVER(a) return puts(a),0

using namespace std;

using namespace __gnu_cxx;

typedef pair<int,int> pii;

typedef unsigned long long UINT;

typedef unsigned int Uint;

typedef long long INT;

typedef pair<INT,INT> PII;



int n,a[200007];

vector<int> b,c;



int main()

{

	scanf("%d",&n);

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

	{

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

		if((n-i)%2==0) c.push_back(a[i]);

		else b.push_back(a[i]);

	}

	for(int i=SZ(b)-1;i>=0;i--)

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

	for(int i=0;i<SZ(c);i++)

		printf("%d%c",c[i],i==SZ(c)-1?'\n':' ');

	return 0;

}


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

#include<cstdio>

#include<cstdlib>

#include<map>

#include<cstring>

#include<algorithm>

#define ll long long

#define Max(x,y) ((x) > (y) ? (x) : (y))

#define Min(x,y) ((x) < (y) ? (x) : (y))

#define Abs(x) ((x) > 0 ? (x) : -(x))

#define mod 1000000007

#define N 300010

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;

}



int n;

int q[N],head1,head2;



int main(){

	int n = read();

	q[100010] = read();

	head1 = 100010;

	head2 = 100010;

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

		if(i&1) q[++head1] = read();

		else q[--head2] = read();

	}

	if(!(n&1)){

		for(;head1 >= head2;head1--)

			printf("%d ",q[head1]);

	}

	else{

		for(;head2 <= head1;head2++)

			printf("%d ",q[head2]);

	}

	puts("");

	return 0;

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

#include<cstring>

int a[200005];

int b[200005];



int main(){

	int n;

	while(scanf("%d",&n)==1){

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

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

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

		}

		if(n%2==0){

			for(int j=0,i=n-1;j<n/2,i>=0;j++,i-=2)

				b[j]=a[i];

			for(int j=n-1,i=n-2;j>=n/2,i>=0;j--,i-=2)

				b[j]=a[i];

		}

		else{

			for(int j=0,i=n-1;j<=n/2,i>=0;j++,i-=2)

				b[j]=a[i];

			for(int j=n-1,i=n-2;j>n/2,i>=0;j--,i-=2)

				b[j]=a[i];

		}

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

			if(i<n-1) printf("%d ",b[i]);

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

		}

	}

	return 0;

}

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

#include<cstdio>

#include<cstdlib>

#include<map>

#include<cstring>

#include<algorithm>

#define ll long long

#define Max(x,y) ((x) > (y) ? (x) : (y))

#define Min(x,y) ((x) < (y) ? (x) : (y))

#define Abs(x) ((x) > 0 ? (x) : -(x))

#define mod 1000000007

#define N 300010

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;

}



int n;

int q[N],head1,head2;



int main(){

	int n = read();

	q[100010] = read();

	head1 = 100010;

	head2 = 100010;

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

		if(i&1) q[++head1] = read();

		else q[--head2] = read();

	}

	if(!(n&1)){

		for(;head1 >= head2;head1--)

			printf("%d ",q[head1]);

	}

	else{

		for(;head2 <= head1;head2++)

			printf("%d ",q[head2]);

	}

	puts("");

	return 0;

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

#include<math.h>

#include<string>

#include<cstring>

#include<iostream>

#include<iomanip>

#include<queue>

#include<stack>

#include<map>

#include<cmath>

#include<fstream>  // 文件读取  ifstream ofstream

#include<algorithm>  

#include<vector>

using namespace std;





int n;



struct List{

	int node;

	List *next;

};



int main()  

{  





	cin>>n;

	List *L;

	L = new List;

	List *end = new List;

	end = L;

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

		int temp;

		cin>>temp;

		List *t = new List;

		t->node = temp;

		if(i%2==0){

			end->next = t;

			end = end->next;

		}else{

			t->next = L->next;

			L->next  = t;

		}

	}



	vector<int>sq;



	L=L->next;

	int index = 0;

	while(index<n){

		sq.push_back(L->node);

		L=L->next;

		index++;

	}



	if(n%2==0){

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

			cout<<sq[i]<<" ";

	}else{

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

			cout<<sq[i]<<" ";

	}





	return 0;





} 






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

#include<cstdio>

#include<cstdlib>

#include<map>

#include<cstring>

#include<algorithm>

#define ll long long

#define Max(x,y) ((x) > (y) ? (x) : (y))

#define Min(x,y) ((x) < (y) ? (x) : (y))

#define Abs(x) ((x) > 0 ? (x) : -(x))

#define mod 1000000007

#define N 300010

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;

}



int n;

int q[N],head1,head2;



int main(){

	int n = read();

	q[100010] = read();

	head1 = 100010;

	head2 = 100010;

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

		if(i&1) q[++head1] = read();

		else q[--head2] = read();

	}

	if(!(n&1)){

		for(;head1 >= head2;head1--)

			printf("%d ",q[head1]);

	}

	else{

		for(;head2 <= head1;head2++)

			printf("%d ",q[head2]);

	}

	puts("");

	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.337508687358599x):
#include<cmath>

#include<cstdio>

#include<cstdlib>

#include<map>

#include<cstring>

#include<algorithm>

#define ll long long

#define Max(x,y) ((x) > (y) ? (x) : (y))

#define Min(x,y) ((x) < (y) ? (x) : (y))

#define Abs(x) ((x) > 0 ? (x) : -(x))

#define mod 1000000007

#define N 300010

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;

}



int n;

int q[N],head1,head2;



int main(){

	int n = read();

	q[100010] = read();

	head1 = 100010;

	head2 = 100010;

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

		if(i&1) q[++head1] = read();

		else q[--head2] = read();

	}

	if(!(n&1)){

		for(;head1 >= head2;head1--)

			printf("%d ",q[head1]);

	}

	else{

		for(;head2 <= head1;head2++)

			printf("%d ",q[head2]);

	}

	puts("");

	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.337508687358599x):
#include<cmath>

#include<cstdio>

#include<cstdlib>

#include<map>

#include<cstring>

#include<algorithm>

#define ll long long

#define Max(x,y) ((x) > (y) ? (x) : (y))

#define Min(x,y) ((x) < (y) ? (x) : (y))

#define Abs(x) ((x) > 0 ? (x) : -(x))

#define mod 1000000007

#define N 300010

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;

}



int n;

int q[N],head1,head2;



int main(){

	int n = read();

	q[100010] = read();

	head1 = 100010;

	head2 = 100010;

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

		if(i&1) q[++head1] = read();

		else q[--head2] = read();

	}

	if(!(n&1)){

		for(;head1 >= head2;head1--)

			printf("%d ",q[head1]);

	}

	else{

		for(;head2 <= head1;head2++)

			printf("%d ",q[head2]);

	}

	puts("");

	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.214143759149452x):
#include<cmath>

#include<cstdio>

#include<cstdlib>

#include<map>

#include<cstring>

#include<algorithm>

#define ll long long

#define Max(x,y) ((x) > (y) ? (x) : (y))

#define Min(x,y) ((x) < (y) ? (x) : (y))

#define Abs(x) ((x) > 0 ? (x) : -(x))

#define mod 1000000007

#define N 300010

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;

}



int n;

int q[N],head1,head2;



int main(){

	int n = read();

	q[100010] = read();

	head1 = 100010;

	head2 = 100010;

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

		if(i&1) q[++head1] = read();

		else q[--head2] = read();

	}

	if(!(n&1)){

		for(;head1 >= head2;head1--)

			printf("%d ",q[head1]);

	}

	else{

		for(;head2 <= head1;head2++)

			printf("%d ",q[head2]);

	}

	puts("");

	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.212533455572478x):
#include<cmath>

#include<cstdio>

#include<cstdlib>

#include<map>

#include<cstring>

#include<algorithm>

#define ll long long

#define Max(x,y) ((x) > (y) ? (x) : (y))

#define Min(x,y) ((x) < (y) ? (x) : (y))

#define Abs(x) ((x) > 0 ? (x) : -(x))

#define mod 1000000007

#define N 300010

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;

}



int n;

int q[N],head1,head2;



int main(){

	int n = read();

	q[100010] = read();

	head1 = 100010;

	head2 = 100010;

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

		if(i&1) q[++head1] = read();

		else q[--head2] = read();

	}

	if(!(n&1)){

		for(;head1 >= head2;head1--)

			printf("%d ",q[head1]);

	}

	else{

		for(;head2 <= head1;head2++)

			printf("%d ",q[head2]);

	}

	puts("");

	return 0;

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

#include <cstdlib>

#include <cstring>

#include <deque>

#include <iostream>

#include <vector>

using namespace std;



const int N = 2e5;

deque<int> q;



int n;



int main()

{

    scanf("%d", &n);

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

    {

        int x;

        scanf("%d", &x);

        if (i & 1)

            q.push_back(x);

        else

            q.push_front(x);

    }

    if ((n & 1) == 0)

    {

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

        {

            printf("%d ", *it);

        }

        return 0;

    }

    else

    {

        deque<int>::iterator it = q.end();

        --it;

        for (; it != q.begin(); --it)

        {

            printf("%d ", *it);

        }

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

        return 0;

    }

    return 0;

}

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

int a[200005],b[100005],c[100005];

int main()

{

    int i,i0,n,m,p1,p2;

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

    {

        p1=p2=1;

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

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

        {

            if(i&1)b[p1++]=a[i];

            else c[p2++]=a[i];

        }

        if(!(n&1))

        {

            for(i=p2-1;i;i--)printf("%d ",c[i]);

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

            {

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

                if(i==p1-1)printf("\n");

                else printf(" ");

            }

        }

        else

        {

            for(i=p1-1;i;i--)printf("%d ",b[i]);

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

            {

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

                if(i==p2-1)printf("\n");

                else printf(" ");

            }

        }

    }

    return 0;

}