stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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;

}

/*

4 2 1 3

*/


// Optimized solution to the same problem (faster):
#include <iostream>

#include<stack>

#include<string.h>

#include<stdio.h>

#include<queue>

#include<math.h>

using namespace std;

long long int a[300000];

long long int b[300000];

int main(void)

{

    int n;

    scanf("%d",&n);

    int i,j;

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

    {

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

    }

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

    {

        b[j]=a[i];

    }

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

    {

        b[j]=a[i];

    }

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

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

    }


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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");

	}

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;





} 






// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;	

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;	

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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]);

	}

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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]);

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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] << " ";

	}

}






// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

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

        else

        {

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

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

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

        else

        {

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

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

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

        else

        {

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

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

int n,a[200010]={0},b[200010]={0};

int main()

{

    int t=0;

    scanf("%d",&n);

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

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

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

    {

        if(i%2==0)

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

        else

        {

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

            t++;

        }

    }

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

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

    printf("\n");

    return 0;

}


// Fastest known solution for this problem: