stablegradients/pie-gem5-pairs huggingface dataset:
// 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.1988237073579375x):
#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;

}
// 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.159279448038348x):
#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;

}
// 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.254155128682459x):
#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;

}
// 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.249681493461162x):
#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;

}
// 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.249681493461162x):
#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;

}
// 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.128346500209429x):
#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;

}
// 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.126762693721785x):
#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;

}
// 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.203443084756779x):
#include<cstdio>

#define MAX 200000+10



int n, a[MAX];



int main()

{

	scanf("%d", &n);

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

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

	int i = n;

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

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

	i = (i == -1) ? 2 : 1;

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

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

	printf("\n");

	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.209407931074183x):
#include<cstdio>

#define MAX 200000+10



int n, a[MAX];



int main()

{

	scanf("%d", &n);

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

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

	int i = n;

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

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

	i = (i == -1) ? 2 : 1;

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

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

	printf("\n");

	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.169783164064606x):
#include<cstdio>

#define MAX 200000+10



int n, a[MAX];



int main()

{

	scanf("%d", &n);

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

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

	int i = n;

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

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

	i = (i == -1) ? 2 : 1;

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

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

	printf("\n");

	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.2648520009851545x):
#include<cstdio>

#define MAX 200000+10



int n, a[MAX];



int main()

{

	scanf("%d", &n);

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

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

	int i = n;

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

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

	i = (i == -1) ? 2 : 1;

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

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

	printf("\n");

	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.260369257942806x):
#include<cstdio>

#define MAX 200000+10



int n, a[MAX];



int main()

{

	scanf("%d", &n);

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

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

	int i = n;

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

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

	i = (i == -1) ? 2 : 1;

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

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

	printf("\n");

	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.260369257942806x):
#include<cstdio>

#define MAX 200000+10



int n, a[MAX];



int main()

{

	scanf("%d", &n);

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

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

	int i = n;

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

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

	i = (i == -1) ? 2 : 1;

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

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

	printf("\n");

	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.138787240212945x):
#include<cstdio>

#define MAX 200000+10



int n, a[MAX];



int main()

{

	scanf("%d", &n);

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

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

	int i = n;

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

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

	i = (i == -1) ? 2 : 1;

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

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

	printf("\n");

	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.137200209272399x):
#include<cstdio>

#define MAX 200000+10



int n, a[MAX];



int main()

{

	scanf("%d", &n);

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

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

	int i = n;

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

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

	i = (i == -1) ? 2 : 1;

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

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

	printf("\n");

	return 0;

}