Match the trees with their leaves