outputs number of parent for each node in console