input: Write a function to create a simple chatbot using Python and state diagrams. The function should initialize the states and manage the conversation flow based on user inputs, updating the state accordingly. The function should also handle unknown inputs gracefully and print the conversation history at the end.
  
  assert chatbot()==None
output: def chatbot():
      states = {
          "start": {
              "message": "Hello! How can I help you today?",
              "responses": {
                  "help": "help",
                  "bye": "end"
              }
          },
          "help": {
              "message": "I can help you with various tasks. What do you need?",
              "responses": {
                  "bye": "end"
              }
          },
          "end": {
              "message": "Goodbye! Have a great day!",
              "responses": {}
          }
      }
      
      current_state = "start"
      conversation_history = []
      
      while current_state != "end":
          conversation_history.append(states[current_state]["message"])
          user_input = input(states[current_state]["message"] + " ")
          conversation_history.append(user_input)
          
          if user_input in states[current_state]["responses"]:
              current_state = states[current_state]["responses"][user_input]
          else:
              conversation_history.append("Sorry, I didn't understand that.")
      
      conversation_history.append(states[current_state]["message"])
      print("\n".join(conversation_history))