input: from typing import Optional, Union
  
  class TreeNode:
      def __init__(self, value):
          self.value = value
          self.left: Optional[TreeNode] = None
          self.right: Optional[TreeNode] = None
  
  def dropLeafNodes(head: Optional[TreeNode]) -> Optional[TreeNode]:
      """
      Implement a function that takes a Huffman tree and drops all its leaf nodes.
  
      >>> head = TreeNode(1)
      >>> head.left = TreeNode(2)
      >>> head.right = TreeNode(3)
      >>> head.left.left = TreeNode(4)
      >>> head.left.right = TreeNode(5)
      >>> head.right.left = TreeNode(6)
      >>> head.right.right = TreeNode(7)
      >>> result = dropLeafNodes(head)
      >>> print((result.value, result.left.value, result.right.value))
      (1, 2, 3)
      """
      if head and not head.left and not head.right:
          return None
  
      if not head:
          return None
  
      head.left = dropLeafNodes(head.left)
      head.right = dropLeafNodes(head.right)
  
      return head
output:     
      if head and not head.left and not head.right:
          return None
  
      if not head:
          return None
  
      head.left = dropLeafNodes(head.left)
      head.right = dropLeafNodes(head.right)
  
      return head
  