stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

using namespace std;

int a[200050];

int main() {

	

	int n,i;

	cin >> n;

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

		cin >> a[i];

	}

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

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

	}

	i++;

	if (n % 2) i += 2;

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

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

	}

	return 0;

}


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

#include<string.h>

#include<stdlib.h>

#define zero 200000

int main()

{

	int n;

	int *numbers;

	int *commands;

	numbers=(int *)malloc(sizeof(int)*400000);

	commands=(int *)malloc(sizeof(int)*200000);

	int i;

	while(scanf("%d",&n)!=-1)

	{

		int mode=1;

		int i1=0,i2=1;

		for(i=0;i<n;i++)scanf("%d",&commands[i]);

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

		{

			if(mode)

			{

				numbers[zero+i1]=commands[i];

				i1++;

				mode=0;	

			}

			else

			{

				numbers[zero-i2]=commands[i];

				i2++;

				mode=1;

			}

		}

		if(mode)

		{

			for(i=zero-i2+1;i<zero+i1;i++)

			{

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

			}

		}

		else

		{

			for(i=zero+i1-1;i>=zero-i2+1;i--)

			{

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

			}

		}

		printf("\n");

	}

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



using namespace std;



int main()

{

	int a[200000];

	int n,i;

	cin>>n;

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

	   cin>>a[i];

	if (n==1) cout<<a[0];

	else

	{

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

		cout<<a[i]<<' ';

		if (n%2==0) i=0;

		else i=1;

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

		cout<<a[i]<<' ';

		cout<<endl;

	}

	return 0;

} 

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

#include<string.h>

#include<stdlib.h>

#define zero 200000

int main()

{

	int n;

	int *numbers;

	int *commands;

	numbers=(int *)malloc(sizeof(int)*400000);

	commands=(int *)malloc(sizeof(int)*200000);

	int i;

	while(scanf("%d",&n)!=-1)

	{

		int mode=1;

		int i1=0,i2=1;

		for(i=0;i<n;i++)scanf("%d",&commands[i]);

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

		{

			if(mode)

			{

				numbers[zero+i1]=commands[i];

				i1++;

				mode=0;	

			}

			else

			{

				numbers[zero-i2]=commands[i];

				i2++;

				mode=1;

			}

		}

		if(mode)

		{

			for(i=zero-i2+1;i<zero+i1;i++)

			{

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

			}

		}

		else

		{

			for(i=zero+i1-1;i>=zero-i2+1;i--)

			{

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

			}

		}

		printf("\n");

	}

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

using namespace std;

long int j[200000];

int main()

{

	int i;

	cin >> i;

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

	{

		cin >> j[z];

	}

	if (i % 2 == 0)

	{

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

		{

			cout << j[z] << " ";

		}

		for (int z = 0; z < i; z = z + 2)

		{

			cout << j[z] << " ";

		}

	}

	else

	{

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

		{

			cout << j[z] << " ";

		}

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

		{

			cout << j[z] << " ";

		}

	}

}

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

#include<string.h>

#include<stdlib.h>

#define zero 200000

int main()

{

	int n;

	int *numbers;

	int *commands;

	numbers=(int *)malloc(sizeof(int)*400000);

	commands=(int *)malloc(sizeof(int)*200000);

	int i;

	while(scanf("%d",&n)!=-1)

	{

		int mode=1;

		int i1=0,i2=1;

		for(i=0;i<n;i++)scanf("%d",&commands[i]);

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

		{

			if(mode)

			{

				numbers[zero+i1]=commands[i];

				i1++;

				mode=0;	

			}

			else

			{

				numbers[zero-i2]=commands[i];

				i2++;

				mode=1;

			}

		}

		if(mode)

		{

			for(i=zero-i2+1;i<zero+i1;i++)

			{

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

			}

		}

		else

		{

			for(i=zero+i1-1;i>=zero-i2+1;i--)

			{

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

			}

		}

		printf("\n");

	}

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

using namespace std;

int main()

{const int size=2e+5;

int a[size],b[size];

int n;

cin>>n;



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

{cin>>a[i];

}



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

{

	

	

	b[j++]=a[i--];

	

	if(i<0)

	break;

	

	b[k--]=a[i];



}





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

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

}

return 0;

 } 

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

#include<string.h>

#include<stdlib.h>

#define zero 200000

int main()

{

	int n;

	int *numbers;

	int *commands;

	numbers=(int *)malloc(sizeof(int)*400000);

	commands=(int *)malloc(sizeof(int)*200000);

	int i;

	while(scanf("%d",&n)!=-1)

	{

		int mode=1;

		int i1=0,i2=1;

		for(i=0;i<n;i++)scanf("%d",&commands[i]);

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

		{

			if(mode)

			{

				numbers[zero+i1]=commands[i];

				i1++;

				mode=0;	

			}

			else

			{

				numbers[zero-i2]=commands[i];

				i2++;

				mode=1;

			}

		}

		if(mode)

		{

			for(i=zero-i2+1;i<zero+i1;i++)

			{

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

			}

		}

		else

		{

			for(i=zero+i1-1;i>=zero-i2+1;i--)

			{

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

			}

		}

		printf("\n");

	}

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

using namespace std;

int a[200050];

int main() {

	

	int n,i;

	cin >> n;

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

		cin >> a[i];

	}

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

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

	}

	i++;

	if (n % 2) i += 2;

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

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

	}

	return 0;

}

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

#include<string.h>

#include<stdlib.h>

#define zero 200000

int main()

{

	int n;

	int *numbers;

	int *commands;

	numbers=(int *)malloc(sizeof(int)*400000);

	commands=(int *)malloc(sizeof(int)*200000);

	int i;

	while(scanf("%d",&n)!=-1)

	{

		int mode=1;

		int i1=0,i2=1;

		for(i=0;i<n;i++)scanf("%d",&commands[i]);

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

		{

			if(mode)

			{

				numbers[zero+i1]=commands[i];

				i1++;

				mode=0;	

			}

			else

			{

				numbers[zero-i2]=commands[i];

				i2++;

				mode=1;

			}

		}

		if(mode)

		{

			for(i=zero-i2+1;i<zero+i1;i++)

			{

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

			}

		}

		else

		{

			for(i=zero+i1-1;i>=zero-i2+1;i--)

			{

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

			}

		}

		printf("\n");

	}

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

#include<cmath>

using namespace std;

int main( )

{

	int size,s,i;

	cin>>size;

	s=size/2;

    int* a=new int[size];

	if(size%2==0) 

	{

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

	{

		s=s+(pow(-1,i))*i;

		cin>>a[s];

	}}

	else{

	

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

	{

		s=s-(pow(-1,i))*i;

		cin>>a[s];

	}}

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

	{

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

	}

	delete [] a;

	return 0;

	

}

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

#include<string.h>

#include<stdlib.h>

#define zero 200000

int main()

{

	int n;

	int *numbers;

	int *commands;

	numbers=(int *)malloc(sizeof(int)*400000);

	commands=(int *)malloc(sizeof(int)*200000);

	int i;

	while(scanf("%d",&n)!=-1)

	{

		int mode=1;

		int i1=0,i2=1;

		for(i=0;i<n;i++)scanf("%d",&commands[i]);

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

		{

			if(mode)

			{

				numbers[zero+i1]=commands[i];

				i1++;

				mode=0;	

			}

			else

			{

				numbers[zero-i2]=commands[i];

				i2++;

				mode=1;

			}

		}

		if(mode)

		{

			for(i=zero-i2+1;i<zero+i1;i++)

			{

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

			}

		}

		else

		{

			for(i=zero+i1-1;i>=zero-i2+1;i--)

			{

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

			}

		}

		printf("\n");

	}

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

#include<list>

using namespace std;

int main(void)

{

	int m,n;

	int t = 1;

	list<int>List;

	scanf("%d", &n);

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

	{

		scanf("%d", &m);

		t = !t;

		if(t)

			List.push_back(m);

		else

			List.push_front(m);

	}

	if (n%2==0) 

		List.reverse();

	for(auto i = List.begin(); i!= List.end();i++)

		printf("%d ",*i);

	return 0;

}

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

#include<string.h>

#include<stdlib.h>

#define zero 200000

int main()

{

	int n;

	int *numbers;

	int *commands;

	numbers=(int *)malloc(sizeof(int)*400000);

	commands=(int *)malloc(sizeof(int)*200000);

	int i;

	while(scanf("%d",&n)!=-1)

	{

		int mode=1;

		int i1=0,i2=1;

		for(i=0;i<n;i++)scanf("%d",&commands[i]);

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

		{

			if(mode)

			{

				numbers[zero+i1]=commands[i];

				i1++;

				mode=0;	

			}

			else

			{

				numbers[zero-i2]=commands[i];

				i2++;

				mode=1;

			}

		}

		if(mode)

		{

			for(i=zero-i2+1;i<zero+i1;i++)

			{

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

			}

		}

		else

		{

			for(i=zero+i1-1;i>=zero-i2+1;i--)

			{

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

			}

		}

		printf("\n");

	}

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

#include<cstdio> 

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int *a=new int [n];

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

	{

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

	}

	if(n%2!=0)          

	{

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

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

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

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

	}

	else

	{

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

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

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

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

	}

	return 0;

} 

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

#include<string.h>

#include<stdlib.h>

#define zero 200000

int main()

{

	int n;

	int *numbers;

	int *commands;

	numbers=(int *)malloc(sizeof(int)*400000);

	commands=(int *)malloc(sizeof(int)*200000);

	int i;

	while(scanf("%d",&n)!=-1)

	{

		int mode=1;

		int i1=0,i2=1;

		for(i=0;i<n;i++)scanf("%d",&commands[i]);

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

		{

			if(mode)

			{

				numbers[zero+i1]=commands[i];

				i1++;

				mode=0;	

			}

			else

			{

				numbers[zero-i2]=commands[i];

				i2++;

				mode=1;

			}

		}

		if(mode)

		{

			for(i=zero-i2+1;i<zero+i1;i++)

			{

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

			}

		}

		else

		{

			for(i=zero+i1-1;i>=zero-i2+1;i--)

			{

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

			}

		}

		printf("\n");

	}

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

#include<stdio.h>

using namespace std;

int a[200050], b[200050];

int main()

{

	int n;

	cin>>n;

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

	    cin>>a[i]; 

	b[n/2]=a[0];

	if(n%2)

	{

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

		{

			b[i]=a[n-1-2*i];

			b[n-1-i]=a[n-2-2*i];

		}

	 }

	 else

	 {

	 	if(n>1)

	 	{	

		 b[n/2]=a[0];

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

		{

			b[i]=a[n-1-2*i];

			b[n-1-i]=a[n-2-2*i];

		 }

	    }

	  } 

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

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

} 

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

#include<string.h>

#include<stdlib.h>

#define zero 200000

int main()

{

	int n;

	int *numbers;

	int *commands;

	numbers=(int *)malloc(sizeof(int)*400000);

	commands=(int *)malloc(sizeof(int)*200000);

	int i;

	while(scanf("%d",&n)!=-1)

	{

		int mode=1;

		int i1=0,i2=1;

		for(i=0;i<n;i++)scanf("%d",&commands[i]);

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

		{

			if(mode)

			{

				numbers[zero+i1]=commands[i];

				i1++;

				mode=0;	

			}

			else

			{

				numbers[zero-i2]=commands[i];

				i2++;

				mode=1;

			}

		}

		if(mode)

		{

			for(i=zero-i2+1;i<zero+i1;i++)

			{

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

			}

		}

		else

		{

			for(i=zero+i1-1;i>=zero-i2+1;i--)

			{

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

			}

		}

		printf("\n");

	}

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

#include<algorithm>

#include<cstdio>

#include<string>

#include<cstring>

#include<cstdlib>

#include<cmath>

using namespace std;

int main()

{

    int n,f[200005]= {0};

    cin>>n;

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

            cin>>f[i];

    if (n%2==0)

    {

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

            cout<<f[i]<<" ";

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

            cout<<f[i]<<" ";

    }

    else

    {

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

            cout<<f[i]<<" ";

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

            cout<<f[i]<<" ";

    }

}


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

#include <stdlib.h>

#include <string>

#include <math.h>

#include <algorithm>

#include <cstring>

#include <cstdio>

#include <stack>

#include <queue>

#include <deque>



using namespace std;



int main()

{   

    int n;

    cin >> n;

    int i;

    deque<int> deq;

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

    {

        int x;

        cin >> x;

        if (i % 2 == 0)

        deq.push_front(x);

        else

        deq.push_back(x);

    }



    if (n % 2 == 1)

    {

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

        cout << deq[i] << ' ' ;

        cout << deq[n-1] << endl;

    }

    else

    {

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

        cout << deq[i] << ' ' ;

        cout << deq[0] << endl;

    }

    

    return 0;

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

#define Ll long long

using namespace std;

const Ll N=4e5+5;

int a[N],l,r,n;

int main()

{

	cin>>n;

	int l=2e5+5,r=2e5+4;

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

		if(i&1)cin>>a[++r];

		else cin>>a[--l];

	if(n&1)for(int i=r;i>=l;i--)cout<<a[i]<<' ';

	else for(int i=l;i<=r;i++)cout<<a[i]<<' ';

}

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

#include<string.h>

#include<algorithm>

using namespace std;

int a[200005];

int main()

{

    int n;

    while(~scanf("%d",&n))

    {

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

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

        if(n==1) printf("%d\n",a[0]);

        else if(n==2) printf("%d %d\n",a[1],a[0]);

        else

        {

            printf("%d",a[n-1]);

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

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

            if(n%2==1)

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

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

            if(n%2==0)

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

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

            printf("\n");

        }

    }

    return 0;

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

#include <deque>

#include <algorithm>

using namespace std;

int main()

{

	ios::sync_with_stdio(false);

	int n;

	cin >> n;

	deque<int> ans;

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

	{

		int x;

		cin >> x;

		if (i & 1)

			ans.push_back(x);

		else

			ans.push_front(x);

	}

	if (n & 1)

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

	for (int i : ans)

		cout << i << ' ';

	cout << endl;

	return 0;

}

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

#include<string.h>

#include<algorithm>

using namespace std;

int a[200005];

int main()

{

    int n;

    while(~scanf("%d",&n))

    {

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

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

        if(n==1) printf("%d\n",a[0]);

        else if(n==2) printf("%d %d\n",a[1],a[0]);

        else

        {

            printf("%d",a[n-1]);

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

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

            if(n%2==1)

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

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

            if(n%2==0)

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

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

            printf("\n");

        }

    }

    return 0;

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

using namespace std;

const int MAXN=2e5+5;

int a[MAXN];

int main()

{

    int n;

    while(cin>>n)

    {

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

        {

            cin>>a[i];

        }

        if(n&1)

        {

            cout<<a[n];

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

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

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

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

            cout<<endl;

        }else

        {

            cout<<a[n];

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

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

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

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

            cout<<endl;

        }

    }

    return 0;

}

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

#include<string.h>

#include<algorithm>

using namespace std;

int a[200005];

int main()

{

    int n;

    while(~scanf("%d",&n))

    {

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

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

        if(n==1) printf("%d\n",a[0]);

        else if(n==2) printf("%d %d\n",a[1],a[0]);

        else

        {

            printf("%d",a[n-1]);

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

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

            if(n%2==1)

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

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

            if(n%2==0)

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

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

            printf("\n");

        }

    }

    return 0;

}
// Slower C++ solution:
/*

TLE発生

原因はvectorのreverseかな？

*/





#include <bits/stdc++.h>

using namespace std;



using LL = long long;



int main(){

    cin.tie(0);

    ios::sync_with_stdio(false);



    LL n;

    cin >> n;

    vector<LL> a(n);

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

        cin >> a[i];

    }



    vector<LL> b;

    b.reserve(n);



    if(n == 1){

        cout << a[0] << endl;

        return 0;

    }



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

        b.push_back(a[i]);

    }

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

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

        b.push_back(a[i]);

    }

    if(n % 2 == 0){

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

    }



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

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

    }



    cout << endl;



    return 0;

}

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

#include<string.h>

#include<algorithm>

using namespace std;

int a[200005];

int main()

{

    int n;

    while(~scanf("%d",&n))

    {

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

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

        if(n==1) printf("%d\n",a[0]);

        else if(n==2) printf("%d %d\n",a[1],a[0]);

        else

        {

            printf("%d",a[n-1]);

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

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

            if(n%2==1)

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

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

            if(n%2==0)

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

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

            printf("\n");

        }

    }

    return 0;

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

using namespace std;



long long int* sat(long long int*a,long long int *b,int n)

{

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

	{

		b[j]=a[j];

	} 

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

	{

		a[k]=b[n-1-k]; 

	}

	return a;

}



int main(void)

{

	int n = 0;

	cin>>n;

	long long int a[n]={0};

	long long int b[n] ={0};

	

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

		long long int h =0;

		cin>>h;

		a[k]=h;

	}



	if(n%2 == 0)

	{

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

		{

			b[i]=a[n-1-2*i];

		}

		for(int j=n/2;j<n;j++)

		{

			b[j]=a[2*(j-n/2)];

		}

	}else

	{

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

		{

			b[i]=a[n-1-2*i];

		}

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

		{

			b[j]=a[2*(j-(n+1)/2)+1];

		}

	}



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

	{

		cout<<b[o]<<" ";

	}

	



	return 0;

}








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

#include<string.h>

#include<algorithm>

using namespace std;

int a[200005];

int main()

{

    int n;

    while(~scanf("%d",&n))

    {

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

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

        if(n==1) printf("%d\n",a[0]);

        else if(n==2) printf("%d %d\n",a[1],a[0]);

        else

        {

            printf("%d",a[n-1]);

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

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

            if(n%2==1)

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

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

            if(n%2==0)

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

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

            printf("\n");

        }

    }

    return 0;

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

#define rep(i,l,p) for(int i = l; i<=p; i++)

#define drep(i,p,l) for(int i = p; i>=l; i++)

using namespace std;



int n;

struct node

{

	int val;

	node *front,*after;

	node(){

		front = NULL;

		after = NULL;

		val = -1;

	}



	node(node* inifront, int inival,node* iniafter){

		val = inival;

		after = iniafter;

		front = inifront;

	}

};



node* first = new node();

node* last = new node();





void lastPlus(int val){

	node *tmp = last->front;

	last->front = new node(last->front,val,last);

	if(tmp != NULL) tmp->after = last->front;

}



void firstPlus(int val){

	node *tmp = first->after;

	first->after = new node(first,val,first->after);



	if(tmp != NULL)tmp->front = first->after;

}

void conbine(){

	node* tmp1 = first;

	while(tmp1->after != NULL){

		tmp1 = tmp1->after;

	//	printf("%d ", tmp1->val);

	}

	//printf("\n");

	

	node* tmp2 = last;

	while(tmp2->front != NULL){

		tmp2 = tmp2->front;

	//	printf("%d ",tmp2->val);

	}

	//printf("\n");



	tmp1->after = tmp2;

	tmp2->front = tmp1;

	//printf("conbine:\n");



//	tmp1 = first;

	// rep(i,1,n){ 

	// 	printf("%d ",tmp1->val);

	// 	tmp1 = tmp1->after;

		

//	}

}

void outputfirst(){

	node* tmp;



	tmp = first->after;

	rep(i,1,n){

		printf("%d ",tmp->val);

		tmp = tmp->after;

	}

}

void outputlast(){

	node *tmp = last->front;

	rep(i,1,n){

		printf("%d ",tmp->val);

		tmp = tmp->front;

	}

}

int main(){

	scanf("%d",&n);

	int t;

	rep(i,1,n){

		scanf("%d",&t);

		if( i % 2 == 1){

			lastPlus(t);

		}else firstPlus(t);

	}

	conbine();

	t = (n+1) % 2 ;

	if ( t == 1){

		outputfirst();

	}else {

		outputlast();

	}



	 return 0;



}

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

#include<string.h>

#include<algorithm>

using namespace std;

int a[200005];

int main()

{

    int n;

    while(~scanf("%d",&n))

    {

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

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

        if(n==1) printf("%d\n",a[0]);

        else if(n==2) printf("%d %d\n",a[1],a[0]);

        else

        {

            printf("%d",a[n-1]);

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

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

            if(n%2==1)

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

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

            if(n%2==0)

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

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

            printf("\n");

        }

    }

    return 0;

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

using namespace std; 

int main() 

{ 	

	cin.tie(0); 	

	cout.tie(0); 

	ios::sync_with_stdio(false); 

	int count; 	

	cin >> count; 

	int *a = new int[count]; 	

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

	{

		cin >> a[i]; 

	}	

	

	deque<int> dq; 

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

	{ 		

		if (i % 2 == 0) 		

		dq.push_front(a[i]); 

		if (i % 2 == 1) 	

		dq.push_back(a[i]); 

	} 

	if (count % 2 != 0) 	

	{ 	

		for (int i = 0; i < dq.size(); i++) 		

		{ 			cout << dq[i] << " "; 		} 	

	} 

	else 

	{ 	

		for (int i = dq.size()-1; i >=0; i--) 	

		{ 			

		cout << dq[i] << " "; 	

		} 

	} 	

	return 0; 

}


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

#include<string.h>

#include<algorithm>

using namespace std;

int a[200005];

int main()

{

    int n;

    while(~scanf("%d",&n))

    {

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

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

        if(n==1) printf("%d\n",a[0]);

        else if(n==2) printf("%d %d\n",a[1],a[0]);

        else

        {

            printf("%d",a[n-1]);

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

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

            if(n%2==1)

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

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

            if(n%2==0)

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

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

            printf("\n");

        }

    }

    return 0;

}