import java.util.*;
class Node{
    int data;
    Node prev, next;
    Node(int data){
        this.data = data;
        this.prev = null;
        this.next = null;
    }
}
class DoublyLinkedList{
    Node head, tail;
    void insert(int data){
        Node newNode = new Node(data);
        if(head == null){
            head=tail=newNode;
        }else{
            tail.next = newNode;
            newNode.prev=tail;
            tail=newNode;
        }
    }
    void display(){
        Node current = head;
        StringBulider sb=new StringBulider();
        while ( current != null){
            sb.append(current.data).append(" ");
            current = current.next;
        }
        System.out.println(sb.toString().trim());
    }
}
public class Main{
    public static void main(string[]args){
        Scanner sc = new Scanner(System.in);
        try{
            int n = integer.parseInt(sc.nextLine().trim());
            if (n<=0){
                System.pout.println("Invaild input");
                return;
            }
            DoublyLinkedList dll = new DoublyLinkedList();
            for (int i = 0; i<n; i++){
                int value = Integer.paresInt(sc.nextLine().trim());
                dll.insert(value);
            }
            dll.display();
        }catch(Exception e){
            System.out.println("Invaild input");
        }
        sc.close();
        }
}