The input is a rooted tree. The first line is an integer n, 1 < n ≦ 90000, which is
the number of nodes. The nodes are given by their unique labels which are integers
from 0 to n-1, and the root is node 0. In the second line, there are n-1 integers which
are the parents of nodes 1, 2,…, n-1, respectively. For any node i, the label of its
parent is smaller than its label.