import java.util.*;
class LinkedList {
class Node{
private int data; //데이터
private Node next; // 뒤쪽 포인터
Node(int data, Node next){
this.data = data;
this.next = next;
}
}
private Node head; //머리노드
private Node crnt; //선택 노드
private Node tail;
public void add(int x) {
Node v = new Node(x, null);
v.next = head.next;
crnt.next = v;
head.next = v;
}
public void delete() {
}
public LinkedList() {
head.next = tail;
crnt.next = tail;
tail = null;
}
}
public class Main {
public static void main(String[] args){
LinkedList data = new LinkedList();
Scanner s = new Scanner(System.in);
while(true) {
int v = s.nextInt();
data.add(v);
}
}
}