A tree with n nodes numbered from 1 to n is represented by
the parent array t, where t[i] is the parent of node i, and
t[i] = 0 means that node i is the root of the tree.
The root is at depth 0, children of the root are at depth 1, and
in general a node is at depth equal to the number of edges on the path
from it to the root.
An additional natural number d is read. Print, in ascending order of
index, all nodes that are at depth d. If no such node exists, print 0.