#include <iostream>
#include <deque>
using namespace std;
int main() {
int n, tmp;
while ( cin >> n ) {
deque <int> input;
for ( int i = 0; i < n; ++i ) {
cin >> tmp;
input.push_back ( tmp );
}
bool rever = false;
while ( n-- ) {
if ( rever ) {
for ( int i = input.size() - 1; i >= 0; --i )
cout << input[i] << " ";
} else {
for ( int i = 0; i < input.size(); ++i )
cout << input[i] << " ";
}
cout << endl;
if ( rever ) {
input.pop_back();
rever = false;
} else {
input.pop_front();
rever = true;
}
}
}
return 0;
}