class LinkedListNode:
  def __init__(self, data):
    self.data = data
    self.next = None
    self.prev = None

class TreeNode:
    def __init__(self, value, reference = None):
        self.value = value
        self.reference = reference
        self.left = None
        self.right = None