stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define ll long long

int a[200100];

int b[100100],c[100100];

int main()

{

    std::ios::sync_with_stdio(false);

    std::cin.tie(0);

    int i,j,k,m,n;

    int bb=0,cc=0;

    cin>>n;

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

        cin>>a[i];

    if(n%2==0)

    {

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

        {

            if(i%2==0)

            {

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

            }

            else

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

        }

    }

    else

    {

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

        {

            if(i%2!=0)

            {

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

            }

            else

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

        }

    }

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

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

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

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

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

    if(cc)

        cout<<c[cc]<<endl;

    return 0;

}


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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

using namespace std;



int n;

vector <int> V;



int main() {

    scanf("%d", &n);

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

    	int temp;

        scanf("%d", &temp);

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

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

    }

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

}

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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

using namespace std;

deque<int> dq;

int n,w;

int main()

{

    cin>>n;

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

    {

        cin>>w;

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

        else dq.push_front(w);

    }

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

    cout<<*i<<" ";

}

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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

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

//#pragma GCC optimize(2)

//#include <immintrin.h>

#include<bits/stdc++.h>

using namespace std;

int main()

{

   	deque<int> a;

   	int n,o;

   	cin >> n;

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

   	{

   		cin >> o;

   		if(i & 1)

   			a.push_back(o);

   		else

   			a.push_front(o);

	}

	if(n & 1)

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

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

	{

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

	}

	puts("");

    return 0;

}

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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

}
// Slower C++ solution:
// luogu-judger-enable-o2

#include<cstdio>

#include<vector>

using namespace std;

int n,x;

vector<int>a;

inline int read(){

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

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

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

	return ret;

}

int main()

{

	n=read();

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

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

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

	return 0;

}

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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

using namespace std;

int n,f[200005],a[200005],b[200005];

int main(){

	scanf("%d",&n);

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

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

		if(i%2==1)a[i/2+1]=f[i];

		else b[i/2]=f[i];

	}

	if(n%2==1){

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

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

	}

	else if(n%2==0){

		for(int i=n/2;i>=1;i--)printf("%d ",b[i]);

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

	}

	printf("\n");

	return 0;

}

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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

using namespace std;

long long a,k;

vector<int>n;

int main()

{

    cin>>a;

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

    {

        cin>>k;

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

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

    }

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

}

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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

using namespace std;

int a[200001],l,r,n,flag;

int main(){

	cin>>n;

	l=n/2-1;

	r=n/2+1;

	flag=n%2;

	cin>>a[n/2];

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

		if(flag==0) cin>>a[l],l--;

		else cin>>a[r],r++;

		flag=!flag;

	}

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

	return 0;

}

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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

#include <vector>

using namespace std;

int main() {

	vector<int> a(200001), b(200001);

	int N;

	cin >> N;



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

	{

		cin >> a[i];

	}



	if (N % 2 == 0) {

		//�����̂Ƃ�

		int harf = N / 2;

		int key = harf;

		int anum = 0;

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

		{

			b[key] = a[anum++];

			b[key-((i + 1) * 2 - 1)] = a[anum++];

			key++;

		}

	}

	else {

		//��̂Ƃ�

		int key = N / 2;

		int anum = 0;

		b[key] = a[anum++];

		key++;

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

		{

			b[key] = a[anum++];

			b[key - (i * 2)] = a[anum++];

			key++;

		}

	}



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

	{

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

	}

	cout << endl;



	return 0;

}

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

#include <string>

#include <vector>

#include <map>

#include <cmath>

#include <algorithm>

#include <functional>

#include <stack>

#include <numeric>

typedef long long ll;

using namespace std;

const int MOD = (int)1e9 + 7;

const ll INF = (ll)1e18 + 7;

#define int long long

#define vint vector<int>

#define pint pair<int, int>

#define pb(a) push_back(a)

#define all(v) v.begin(), v.end()

#define dbg(x) cerr << #x << " = " << (x) << endl

#define yn(b) cout << ((b) ? "Yes" : "No") << endl

#define YN(b) cout << ((b) ? "YES" : "NO") << endl



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

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



signed main()

{

	cin.tie(0);

	ios::sync_with_stdio(false);



	int n;

	cin >> n;

	vint t(n), a(n);

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

	{

		cin >> a[i];

	}



	int now = n;

	bool flg = true;



	if (n % 2 == 0)

	{

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

		{

			if (flg)

			{

				t[i] = now;

				if (t[i] == 2)

				{

					now = 1;

					flg = false;

					continue;

				}

				now -= 2;

			}

			else

			{

				t[i] = now;

				now += 2;

			}

		}

	}

	else

	{

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

		{

			if (flg)

			{

				t[i] = now;

				if (t[i] == 1)

				{

					now = 2;

					flg = false;

					continue;

				}

				now -= 2;

			}

			else

			{

				t[i] = now;

				now += 2;

			}

		}

	}



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

	{

		cout << a[t[i] - 1] << " ";

	}



	return 0;

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

using namespace std;

deque<int> dq;

int n,w;

int main()

{

    cin>>n;

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

    {

        cin>>w;

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

        else dq.push_front(w);

    }

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

    cout<<*i<<" ";

}

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

int n,a[200010];

int main()

{

	scanf("%d",&n);

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

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

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

	return 0;

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

using namespace std;

int n,x,a[200005],b,e,i;

int main(){

    cin>>n;

    b=ceil((double)(n+1)/2);

    if(n%2==0){

        e=-1;

    }else{

        e=1;

    }

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

        cin>>x;

        a[b]=x;

        b+=i*e;

        e*=-1;

    }

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

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

    }

    return 0;

}

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

int n,a[200010];

int main()

{

	scanf("%d",&n);

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

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

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

	return 0;

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

using namespace std;

int n,x,a[200005],b,e,i;

int main(){

    cin>>n;

    b=ceil((double)(n+1)/2);

    if(n%2==0){

        e=-1;

    }else{

        e=1;

    }

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

        cin>>x;

        a[b]=x;

        b+=i*e;

        e*=-1;

    }

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

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

    }

    return 0;

}

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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

using namespace std;

int n,a[200005];

int main(){

    cin >> n;

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

        cin >> a[i];

    }

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

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

    }

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

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

    }

    cout << endl;

    return 0;

}

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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

using namespace std;

deque<int>l;

int n,w;

int main(){

    cin>>n;

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

        cin>>w;

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

        else l.push_front(w);

    }

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

    cout<<*i<<" ";

}

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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

#include<iostream>

using namespace std;

int n,a[100005],b[100005];

int main()

{

    cin>>n;

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

    {

    	cin>>a[i]>>b[i];

    }

    if(n%2==1)

    {

    	cin>>a[n/2+1];

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

    	{

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

    	}

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

    	{

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

    	}

    	cout<<endl;

    }

    else

    {

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

    	{

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

    	}

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

    	{

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

    	}

    	cout<<endl;

    }

    

}

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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

#define INF 200001

using namespace std;

inline int read()

{

	register int number_read=0,if_ok_read=1;

	char ch_read=getchar();

	while(ch_read<'0'||ch_read>'9')

	{

		if(ch_read=='-')

			if_ok_read=-1;

		ch_read=getchar();

	}

	while(ch_read>='0'&&ch_read<='9')

	{

		number_read=number_read*10+ch_read-'0';

		ch_read=getchar();

	}

	return number_read*if_ok_read;

}

inline void write(register int x_write)

{

    if(x_write<0)

	{

    	putchar('-');

		x_write=-x_write;

	}

    if(x_write>9)

		write(x_write/10);

    putchar(x_write%10+'0');

    return ;

}

int main()

{

	//freopen(".in","r",stdin);

	//freopen(".out","w",stdout);

	int n=read(),a[INF]={0};

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

		a[i]=read();

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

	{

		write(a[i]);

		putchar(' ');

	} 

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

    {

		write(a[i]);

		putchar(' ');

	}

	putchar('\n');

	return 0;

}


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

int n,a[200010];

inline int read(){ 

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

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

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

    return ret;

}

int main()

{

    n=read();

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

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

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

    return 0;

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

#define INF 200001

using namespace std;

inline int read()

{

	register int number_read=0,if_ok_read=1;

	char ch_read=getchar();

	while(ch_read<'0'||ch_read>'9')

	{

		if(ch_read=='-')

			if_ok_read=-1;

		ch_read=getchar();

	}

	while(ch_read>='0'&&ch_read<='9')

	{

		number_read=number_read*10+ch_read-'0';

		ch_read=getchar();

	}

	return number_read*if_ok_read;

}

inline void write(register int x_write)

{

    if(x_write<0)

	{

    	putchar('-');

		x_write=-x_write;

	}

    if(x_write>9)

		write(x_write/10);

    putchar(x_write%10+'0');

    return ;

}

int main()

{

	//freopen(".in","r",stdin);

	//freopen(".out","w",stdout);

	int n=read(),a[INF]={0};

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

		a[i]=read();

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

	{

		write(a[i]);

		putchar(' ');

	} 

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

    {

		write(a[i]);

		putchar(' ');

	}

	putchar('\n');

	return 0;

}


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

using namespace std;

int a[200010];

int main(){

	int n;

	cin>>n;

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

	cin>>a[i];

	if(n%2==0){

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

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

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

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

	}

	else{

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

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

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

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

	}

	cout<<"\n";

	return 0;

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

#define INF 200001

using namespace std;

inline int read()

{

	register int number_read=0,if_ok_read=1;

	char ch_read=getchar();

	while(ch_read<'0'||ch_read>'9')

	{

		if(ch_read=='-')

			if_ok_read=-1;

		ch_read=getchar();

	}

	while(ch_read>='0'&&ch_read<='9')

	{

		number_read=number_read*10+ch_read-'0';

		ch_read=getchar();

	}

	return number_read*if_ok_read;

}

inline void write(register int x_write)

{

    if(x_write<0)

	{

    	putchar('-');

		x_write=-x_write;

	}

    if(x_write>9)

		write(x_write/10);

    putchar(x_write%10+'0');

    return ;

}

int main()

{

	//freopen(".in","r",stdin);

	//freopen(".out","w",stdout);

	int n=read(),a[INF]={0};

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

		a[i]=read();

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

	{

		write(a[i]);

		putchar(' ');

	} 

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

    {

		write(a[i]);

		putchar(' ');

	}

	putchar('\n');

	return 0;

}


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

#include<deque>

#include<iostream>

using namespace std;

int N, a;

deque<int> q;

int main() 

{

    cin >> N;

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

    {

        cin >> a;

        if(i & 1) q.push_back(a);

        else q.push_front(a);

    }

    if(N & 1) reverse(q.begin(), q.end());

    for(auto it = q.begin(); it != q.end(); ++it)

        cout << *it << ' ';

    cout << '\n';

    return 0;

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

#define INF 200001

using namespace std;

inline int read()

{

	register int number_read=0,if_ok_read=1;

	char ch_read=getchar();

	while(ch_read<'0'||ch_read>'9')

	{

		if(ch_read=='-')

			if_ok_read=-1;

		ch_read=getchar();

	}

	while(ch_read>='0'&&ch_read<='9')

	{

		number_read=number_read*10+ch_read-'0';

		ch_read=getchar();

	}

	return number_read*if_ok_read;

}

inline void write(register int x_write)

{

    if(x_write<0)

	{

    	putchar('-');

		x_write=-x_write;

	}

    if(x_write>9)

		write(x_write/10);

    putchar(x_write%10+'0');

    return ;

}

int main()

{

	//freopen(".in","r",stdin);

	//freopen(".out","w",stdout);

	int n=read(),a[INF]={0};

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

		a[i]=read();

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

	{

		write(a[i]);

		putchar(' ');

	} 

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

    {

		write(a[i]);

		putchar(' ');

	}

	putchar('\n');

	return 0;

}


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

using namespace std;

int n,v,l[200005],b,e;//数组直接开200000

int main(){

    cin>>n;

    b=ceil((double)(n+1)/2);//第一个数的位置

    e=(n%2==0)?(-1):(1);//判断是偶数还是奇数

    for(int i=1;i<=n;i++){//一定要从一开始

        cin>>v;

        l[b]=v;

        b+=i*e;//利用i变量，乘上符号

        e*=-1;//变符号

    }

    for(int i=1;i<=n;i++)//这个也是要从一开始

    cout<<l[i]<<" ";

    return 0;

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

#define INF 200001

using namespace std;

inline int read()

{

	register int number_read=0,if_ok_read=1;

	char ch_read=getchar();

	while(ch_read<'0'||ch_read>'9')

	{

		if(ch_read=='-')

			if_ok_read=-1;

		ch_read=getchar();

	}

	while(ch_read>='0'&&ch_read<='9')

	{

		number_read=number_read*10+ch_read-'0';

		ch_read=getchar();

	}

	return number_read*if_ok_read;

}

inline void write(register int x_write)

{

    if(x_write<0)

	{

    	putchar('-');

		x_write=-x_write;

	}

    if(x_write>9)

		write(x_write/10);

    putchar(x_write%10+'0');

    return ;

}

int main()

{

	//freopen(".in","r",stdin);

	//freopen(".out","w",stdout);

	int n=read(),a[INF]={0};

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

		a[i]=read();

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

	{

		write(a[i]);

		putchar(' ');

	} 

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

    {

		write(a[i]);

		putchar(' ');

	}

	putchar('\n');

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7764404523695363x):
/////////////////////////////////////////////



//

//	FileName	:	First.cpp

//	Creator		:	Fm

//	Date		:	2019-11-15 01:18

//	Comment		:	OJ(P1227)

//

///////////////////////////////////////////



//#include "pch.h"

#include <iostream>

#include <stdio.h>

#include <stdlib.h>

#include <algorithm>

#include <math.h>

#include <stack>

#include <string>

#include <string.h>

#include <set>

#include <list>

#include <queue>

#include <map>



using namespace std;

#define	MAXNUM		10010

#define	EPS         0.0001

#define MODNUM		2e31





typedef unsigned char       BYTE;

typedef int                 BOOL;

typedef unsigned long       DWORD;



int main(int argc, char* argv[])

{

	int				nN;

	int				nA;

	deque<int>		q;

	scanf("%d", &nN);



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

	{

		scanf("%d", &nA);

		if (i & 1)

			q.push_back(nA);

		else

			q.push_front(nA);

	}

	if (nN & 1)

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

	for (auto iter = q.begin(); iter != q.end(); iter++)

		cout << *iter << " ";

	printf("\n");

Exit0:



	return 0;

}