input: 
  def sort_linked_list(linked_list: LinkedList) -> LinkedList:
      """This function sorts a given linked list in ascending order.
      A linked list is a sequence of elements in which each element has a link
      (or reference) to the next element.
      The function should sort the linked list while preserving the links between
      the elements.
  
      For example:
      >>> linked_list = LinkedList()
      >>> node1 = Node(3)
      >>> node2 = Node(1)
      >>> node3 = Node(2)
      >>> linked_list.head = node1
      >>> node1.next = node2
      >>> node2.next = node3
      >>> sorted_list = sort_linked_list(linked_list)
      >>> sorted_list.print_list()
      1
      2
      3
      """
  
output:     if not linked_list.head:
          return linked_list
  
      sorted_list = LinkedList()
      current = linked_list.head
      while current:
          next_node = current.next
          current.next = None
          if not sorted_list.head:
              sorted_list.head = current
          else:
              if current.data < sorted_list.head.data:
                  current.next = sorted_list.head
                  sorted_list.head = current
              else:
                  temp = sorted_list.head
                  while temp.next and temp.next.data < current.data:
                      temp = temp.next
                  current.next = temp.next
                  temp.next = current
          current = next_node
  
      return sorted_list