input: Write a python function to build a tree from parent-child relationships and return the root node.
  assert buildTree([(1, 2), (1, 3), (3, 4), (3, 5)]).data == 1
  assert buildTree([(1, 2), (2, 3), (2, 4), (4, 5)]).data == 1
  assert buildTree([(1, 2)]).data == 1
output: class TreeNode:
      def __init__(self, data):
          self.data = data
          self.children = []
  
  def buildTree(pairs):
      if not pairs:
          return None
  
      nodes = {}
      children = set()
  
      for parent, child in pairs:
          if parent not in nodes:
              nodes[parent] = TreeNode(parent)
          if child not in nodes:
              nodes[child] = TreeNode(child)
          
          nodes[parent].children.append(nodes[child])
          children.add(child)
  
      root = None
      for node in nodes:
          if node not in children:
              root = nodes[node]
              break
  
      return root