
#include <typeinfo>
#include <iostream>

list_node* reverse(list_node* head);

int main () {
    int n;
    while (std::cin >> n)
    {
        list_node* node = nullptr;
        list_node* head = nullptr;

        for (int i = 0; i < n; ++i)
        {
            list_node* new_node = new list_node;
            std::cin >> new_node->m_value;
            new_node->m_previous = node;
            if (node)
                node->m_next = new_node;
            
            node = new_node;

            if (i == 0)
                head = new_node;
        }

        head = reverse(head);

        for (int i = 0; i < n; ++i)
        {
            if (i > 0)
                std::cout << " ";
            std::cout << head->m_value;

            list_node* used_node = head;
            head = head->m_next;
            delete used_node;
        }
        std::cout << std::endl;
    }
}
