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

}
// 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.7969284939410521x):
#include <bits/stdc++.h>

using namespace std;

int n, a;

deque<int> q;

int main()

{

    scanf("%d", &n);

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

    {

        scanf("%d", &a);

        if (i & 1)

            q.push_back(a);

        else

            q.push_front(a);

    }

    if (n & 1)

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

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

        printf("%d ", *it);

    printf("\n");

    return 0;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 4.920402601432984x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.309406244953771x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.336309589946208x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.305625545900013x):
#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();

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

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

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.332509733674814x):
#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();

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

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

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.08949762805537x):
#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;

}



static const int buf_size = 4096;

static int write_pos = 0;

static char write_buf[buf_size];



inline void writeChar( int x ) {

    if (write_pos == buf_size)

        fwrite(write_buf, 1, buf_size, stdout), write_pos = 0;

    write_buf[write_pos++] = x;

}



template <class T> 

inline void writeInt( T x, char end ) {

    if (x < 0)

        writeChar('-'), x = -x;

     

    char s[24];

    int n = 0;

    while (x || !n)

        s[n++] = '0' + x % 10, x /= 10;

    while (n--)

        writeChar(s[n]);

    if (end)

        writeChar(end);

}



struct Flusher {

    ~Flusher() {

        if (write_pos)

            fwrite(write_buf, 1, write_pos, stdout), write_pos = 0;

    }

} flusher;



int a[2000001];

int main(){

  int n=read(),i;

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

  for(i=n-1;i>=0;i-=2)writeInt(a[i], ' ');

  for(i=n%2;i<=n-1;i+=2)writeInt(a[i], ' ');

  writeChar('\n');

  return 0;

}
// Slower C++ solution:
//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;

}

// Faster C++ solution for the same problem (measured speedup: 5.333414634871816x):
// 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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.239271914978421x):
// 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;

}
// Slower C++ solution:
#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]<<" ";

}

// Faster C++ solution for the same problem (measured speedup: 5.3316597114191975x):
// 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;

}
// Slower C++ solution:
//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;

}

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

using namespace std;

int a[600001],h,t,n,x;

int main(){

	scanf("%d",&n);

	h=n+1,t=n;

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

		scanf("%d",&x);

		i&1?a[--h]=x:a[++t]=x;

	}

	if(n&1)

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

	else for(int i=t;i>=h;i--)printf("%d ",a[i]);

	puts("");

	return 0;

}
// Slower C++ solution:
#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;

}


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

using namespace std;

int a[600001],h,t,n,x;

int main(){

	scanf("%d",&n);

	h=n+1,t=n;

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

		scanf("%d",&x);

		i&1?a[--h]=x:a[++t]=x;

	}

	if(n&1)

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

	else for(int i=t;i>=h;i--)printf("%d ",a[i]);

	puts("");

	return 0;

}
// Slower C++ solution:
#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]<<" ";

}

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

using namespace std;

int a[600001],h,t,n,x;

int main(){

	scanf("%d",&n);

	h=n+1,t=n;

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

		scanf("%d",&x);

		i&1?a[--h]=x:a[++t]=x;

	}

	if(n&1)

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

	else for(int i=t;i>=h;i--)printf("%d ",a[i]);

	puts("");

	return 0;

}
// Slower C++ solution:
#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]<<' ';

}

// Faster C++ solution for the same problem (measured speedup: 5.302313957161906x):
#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]);

}
// Slower C++ solution:
#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]<<' ';

}

// Faster C++ solution for the same problem (measured speedup: 5.217155708110411x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.342619429145177x):
#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;

}
// Slower C++ solution:
#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]);

}

// Faster C++ solution for the same problem (measured speedup: 5.210144800632792x):
#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;

}