printLeafAndCodes