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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

}

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

    }

    

}

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

}

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

}


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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

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

int main(){

	int n,a[200002];

	cin >> n;

	int f=n/2,b=n/2+1;

	FOR(i,0,n){

		if((n-i)%2 == 0) cin >> a[b++];

		else cin >> a[f--];

	}

	FOR(i,f+1,b) cout << a[i] << " ";

	return 0;

}

// Optimized solution to the same problem (faster):
#define FOR(i,a,b) for(int i=a;i<b;i++)

#include <cstdio>

int main(){

	int n,a[200002];

	scanf("%d",&n);	//cin >> n;

	int f=n/2,b=n/2+1;

	FOR(i,0,n){

		if((n-i)%2 == 0) scanf("%d",&a[b++]);	//cin >> a[b++];

		else scanf("%d",&a[f--]);	//cin >> a[f--];

	}

	FOR(i,f+1,b) printf("%d ",a[i]);	//cout << a[i] << " ";

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cmath>

#include <numeric>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <time.h>

#include <list>

#include <bitset>



using namespace std;

typedef long long ll;

template<class T=ll> 

T in(){T x;cin>>x;return (x);}

template<class T> 

void print(T &x){cout<<x<<"\n";}

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

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

#define reps(x,c) for(auto x:c)

#define all(x) begin(x), end(x)

#define pb(a) emplace_back(a) 

#define mp(a,b) make_pair((a),(b))

#define pl pair<ll,ll>

#define INF 2147483600

#define MOD 1000000007

#define fi first

#define se second

#define dbg(x) cerr << #x"="<< (x) << "\n"

#define dbgv(x) cerr<<#x<<"\n";reps(y,x){cerr<<y<<" ";}cerr<<"\n"



int main(){

  ll n=in(),a;    

  deque<ll> b;

  rep(i,n){

    scanf("%lld",&a);

    if(i%2){

      b.push_back(a);

    }else{

      b.push_front(a);

    }

  }

  if(n%2){

    rep(i,n){

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

    }

  }else{

    rep(i,n){

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

    }

  }

  printf("\n");

  return 0;

}

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

using namespace std;

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

inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline int read(){

  int a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}

int a[2000001];

int main(){

  int n=read(),i;

  rep(i,n){

    a[i]=read();

  }

  if(n%2){

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

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

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

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

  }else{

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

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

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

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

  }

  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cmath>

#include <numeric>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <time.h>

#include <list>

#include <bitset>



using namespace std;

typedef long long ll;

template<class T=ll> 

T in(){T x;cin>>x;return (x);}

template<class T> 

void print(T &x){cout<<x<<"\n";}

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

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

#define reps(x,c) for(auto x:c)

#define all(x) begin(x), end(x)

#define pb(a) emplace_back(a) 

#define mp(a,b) make_pair((a),(b))

#define pl pair<ll,ll>

#define INF 2147483600

#define MOD 1000000007

#define fi first

#define se second

#define dbg(x) cerr << #x"="<< (x) << "\n"

#define dbgv(x) cerr<<#x<<"\n";reps(y,x){cerr<<y<<" ";}cerr<<"\n"



inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline int read(){

  int a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}

int main(){

  ll n=in(),a;    

  deque<ll> b;

  rep(i,n){

    a=read();

    if(i%2){

      b.push_back(a);

    }else{

      b.push_front(a);

    }

  }

  if(n%2){

    rep(i,n){

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

    }

  }else{

    rep(i,n){

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

    }

  }

  printf("\n");

  return 0;

}

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

using namespace std;

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

inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline int read(){

  int a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}

int a[2000001];

int main(){

  int n=read(),i;

  rep(i,n){

    a[i]=read();

  }

  if(n%2){

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

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

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

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

  }else{

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

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

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

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

  }

  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
//666yuchen

#include<bits/stdc++.h>

using namespace std;

int n,a;

vector<int>b;

int main()

{

  cin>>n;

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

  {

  	scanf("%d",&a);

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

  	else b.insert(b.begin(),a);

  }

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

  return 0;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

#include<cstdio>

#pragma GCC optimize(3)

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]);

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

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <iostream>

#include <cmath>

#include <cstring>

#include <algorithm>

using namespace std;

int n,a[1000005];

int read(){

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

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

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

	return ans;

}

int main(){

	n=read();

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

	if (n&1){

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

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

	}

	else {

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

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

	}

	return 0;

}


// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

#include<cstdio>

#pragma GCC optimize(3)

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]);

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

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <vector>

#include <cstdio>

#include <iostream>

#include <algorithm>

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]<<" ";

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

#include<cstdio>

#pragma GCC optimize(3)

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]);

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

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

const int N=200005;

int b;

int n;

int a[N];

int x;

int main()

{

	scanf("%d",&n);

	b=1;

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

		scanf("%d",&x);

		a[n/2+(i/2)*b]=x;

		b=-b;

	}

	if(n%2==0)for(int i=0;i<n;i++)cout<<a[i]<<' ';

	else for(int i=n-1;i>=0;i--)cout<<a[i]<<' ';

}

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

#include<cstring>

#include<algorithm>

#include<map>

#define ll long long

#define inf (1ll<<60)

#define N 200005

#define mod 1000000007

#define rep(i,j,k) for (ll i=j;i<=k;++i)

#define per(i,j,k) for (ll i=j;i>=k;--i)

using namespace std;

inline ll read(){

	char ch=getchar(); ll x=0,f=1;

	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;

}

ll n,l,r,now,a[N],b[N];

int main(){

	n=read();

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

	l=1; r=n; now=1;

	per(i,n,1)

		if (now){

			b[l]=a[i];

			++l; now^=1;

		}else{

			b[r]=a[i];

			--r; now^=1;

		}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <deque>

using namespace std;



const int N = 2e5 + 5;



int n;

deque<int> Q;



int main() {

	ios::sync_with_stdio(false);

	cin >> n;

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

		int x;

		cin >> x;

		if (i & 1) Q.push_back(x);

		else Q.push_front(x);

	}

	if (n & 1) {

		for (auto it = Q.rbegin(); it != Q.rend(); ++it)

			cout << *it << ' ';

		cout << endl;

	} else {

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

			cout << *it << ' ';

		cout << endl;

	}

	return 0;

}

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

#include<stdlib.h>



int main() {

	int n;

	scanf("%d", &n);



	int *a;

	int head, tail,b;



	a = (int *)malloc(n * sizeof(int));

	if (n % 2 == 1) {

		head = (n - 1) / 2 - 1;

		tail = (n - 1) / 2 + 1;

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

			scanf("%d", &b);

			if (i == 0) {

				a[head + 1] = b;

			}

			else if (i % 2 == 1) {

				a[tail] = b;

				tail++;

			}

			else {

				a[head] = b;

				head--;

			}

		}

	}

	else{

		head = n / 2 - 1;

		tail = n / 2;

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

			scanf("%d", &b);

			if (i % 2 == 0) {

				a[tail] = b;

				tail++;

			}

			else {

				a[head] = b;

				head--;

			}

		}

	}

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

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

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

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) 

		for (int i=q.size()-1;i>=0;--i) printf("%d ",q[i]);

	else 

		for (int i=0;i<q.size();++i) printf("%d ",q[i]);

}

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

#include<stdlib.h>



int main() {

	int n;

	scanf("%d", &n);



	int *a;

	int head, tail,b;



	a = (int *)malloc(n * sizeof(int));

	if (n % 2 == 1) {

		head = (n - 1) / 2 - 1;

		tail = (n - 1) / 2 + 1;

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

			scanf("%d", &b);

			if (i == 0) {

				a[head + 1] = b;

			}

			else if (i % 2 == 1) {

				a[tail] = b;

				tail++;

			}

			else {

				a[head] = b;

				head--;

			}

		}

	}

	else{

		head = n / 2 - 1;

		tail = n / 2;

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

			scanf("%d", &b);

			if (i % 2 == 0) {

				a[tail] = b;

				tail++;

			}

			else {

				a[head] = b;

				head--;

			}

		}

	}

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

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

	}

	return 0;

}

// Fastest known solution for this problem: