import java.util.Scanner;
import javax.swing.JOptionPane;
/**
* @name node
* @author 顾博君
* @date 2013-2-28 链表的一个节点类
*/
class node {
Object data;// 链表的数据域
node next;// 链表的指针域
public node(Object d) {// 为新建的链表赋值
data = d;
next = null;
}
public node() {
data = null;
next = null;
}
}
/**
* @date 2013-3
* @author 顾博君
* @name list 链表类
*/
class list {
node head = null;// 链表头
node tail = null;// 链表尾
node pointer = null;// 链表的当前节点
/* 插入一个节点元素 */
public void insert(Object d) {
node e = new node(d);
if (head == null) {
head = e;
pointer = e;
} else {
pointer.next = e;
pointer = pointer.next;
}
}
/* 当前指针移动到下一个位置 */
public node movenext() {
if (pointer == null) {
System.out.println("wrong\n");
return null;
} else
return pointer.next;
}
/* 节点转化为整型 */
public int NI(node n) {
return Integer.parseInt(n.data.toString());
}
public void sort() {
if (head == null || head.next == null)
return;
pointer = head.next;
node p = head;
p.next = null;
node t = pointer;
while (pointer != null) {
pointer = pointer.next;
p = head;
while (NI(t) > NI(p) && p.next != null) {
p = p.next;
}
t.next = p.next;
p.next = t;
}
}
public void print() {
pointer = head;
while (pointer != null) {
System.out.print(pointer.data + " ");
pointer = movenext();
}
}
}
public class javalist {
public static void main(String args[]) {
list a = new list();
Scanner cin = new Scanner(System.in);
int i = cin.nextInt();
while (i != 0) {
cin = new Scanner(System.in);
int j = cin.nextInt();
a.insert(j);
// System.out.print(j+" ");
i--;
}
a.print();
JOptionPane.showMessageDialog(null, "ok");
}
}